Re: [R] iconv question: SQL Server 2005 to R

2013-10-09 Thread Prof Brian Ripley
On 09/10/2013 10:37, Milan Bouchet-Valat wrote: Le mardi 08 octobre 2013 à 16:02 -0700, Ira Sharenow a écrit : A colleague is sending me quite a few files that have been saved with MS SQL Server 2005. I am using R 2.15.1 on Windows 7. I am trying to read in the files using standard techniques.

Re: [R] Help required graphing factors with predicted model settings

2013-10-09 Thread Jim Lemon
On 10/10/2013 03:52 PM, Rebecca Stirnemann wrote: Thanks Jim for helping, Your sample data actually looks like my dataset. The one I put up looks strange for some reason so please ignore that. I have three landusenumb variables 1 2 and 3. is rep (1,2,3) correct? When I run the following code I

Re: [R] Help required graphing factors with predicted model settings

2013-10-09 Thread Rebecca Stirnemann
But with three lines for the three habitat types and grass length at the bottom On Thu, Oct 10, 2013 at 5:52 PM, Rebecca Stirnemann wrote: > Thanks Jim for helping, > > Your sample data actually looks like my dataset. The one I put up looks > strange for some reason so please ignore that. > I

Re: [R] Help required graphing factors with predicted model settings

2013-10-09 Thread Rebecca Stirnemann
Thanks Jim for helping, Your sample data actually looks like my dataset. The one I put up looks strange for some reason so please ignore that. I have three landusenumb variables 1 2 and 3. is rep (1,2,3) correct? When I run the following code I am getting: > mod1 <- glmer(frat ~ flandusenumb + g

Re: [R] knitr and functions generating latex

2013-10-09 Thread Yihui Xie
I think in most cases you are probably on the wrong track if you have to generate LaTeX code for figures from R code (LaTeX tables are another story), but your case might be different. You did not give a specific example on why you had to do that, so I cannot give any advice for now. My best guess

Re: [R] Help required graphing factors with predicted model settings

2013-10-09 Thread Jim Lemon
On 10/10/2013 08:35 AM, Rebecca Stirnemann wrote: Dear R wizards, Though I hate to do it after weeks of my code not working I need some help since I cant find an example which seems to work. I am trying to create a graph which show the probability of predation of a nest on one side (either 1 to

[R] knitr and functions generating latex

2013-10-09 Thread Daryl Morris
Hi, I have what I think should be a basic question on knitr. I am just moving to knitr, and previously I had created functions which automatically created latex wrappers for many (100s) figures. I also have other functions which automatically create pages worth of latex tables. The knitr m

[R] AES algorithm package

2013-10-09 Thread b. alzahrani
Hi Is there any implementation for AES encryption algorithm in R? Thanks Bander __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide c

Re: [R] makeCluster help needed

2013-10-09 Thread Jeffrey Flint
Uwe, Good news. I installed 3.0.2, and the parallel package examples ran successfully. This time a firewall window popped up. Probably the firewall was the problem with the snow package too, but for some reason the window didn't pop up with the snow package. Thanks for the suggestion to use "pa

Re: [R] Possible loop/ if statement query

2013-10-09 Thread arun
Hi, Try: b1<- b b1[!b1>=7]<- NA lst1 <- split(b1,cumsum(c(0,abs(diff(b>=7)  indx <- as.logical(((seq_along(lst1)-1)%%2)) lst1[indx]<- lapply(seq_along(lst1[indx]),function(i) {lst1[indx][[i]]<- rep(i,length(lst1[indx][[i]]))})  C2 <- unlist(lst1,use.names=FALSE)  all.equal(c1,C2) #[1] TRU

[R] Biclustering issues with biclust()

2013-10-09 Thread michele caseposta
Hello everyone, I am trying to test some biclustering algorithms, and I am using the package biclust. I tried to bicluster a very simple matrix, and it seems that I cannot obtain what I was expecting, even though the cluster, to me, seem pretty obvious. The code is the following: mat1<- matrix(c

Re: [R] Add function to each row excluding certain columns

2013-10-09 Thread arun
Hi, Try: !colnames(example1)%in%omit #[1]  TRUE  TRUE  TRUE  TRUE FALSE FALSE  TRUE  TRUE  TRUE  cbind(example1, `MAX without Restriction`=apply(example1[,!colnames(example1)%in% omit],1,max,na.rm=TRUE)) A.K. Thank you again! But somehow the which(function) didn't work... The problem is, tha

Re: [R] Add function to each row excluding certain columns

2013-10-09 Thread David Winsemius
On Oct 9, 2013, at 3:31 PM, laro wrote: > Thank you again! But somehow the which(function) didn't work... > The problem is, that the columns I want to drop in further calculations will > not have the same name, that's why I'm looking for a solution to make a > vector of the columns that should be

[R] Possible loop/ if statement query

2013-10-09 Thread Benjamin Gillespie
Dear r genii, I hope you can help. I have vector 'b': b=c((1:10),sort(1:9,decreasing=TRUE),(2:12),sort(6:11,decreasing=TRUE),(7:13)) and, from 'b' I wish to create vector 'c': c=c( NA,NA,NA,NA,NA,NA,1,1,1,1,1,1,1,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,2,2,2,2,2,2,2,2,2,2,2,NA,3,3,3,3,3,3,3) The

Re: [R] Add function to each row excluding certain columns

2013-10-09 Thread laro
Thank you again! But somehow the which(function) didn't work... The problem is, that the columns I want to drop in further calculations will not have the same name, that's why I'm looking for a solution to make a vector of the columns that should be omitted, like omit<-c("Restriction 1","Restricti

[R] Add function to each row excluding certain columns

2013-10-09 Thread laro
Hello I've got a matrix of the following form BARNBCGEBCVNBEANRestriction 1 Restriction 2 Restriction 3 Restriction 4 Restriction 5 alpha.1 0.000172449 7.87E-05-0.0032710440.000921609 9.28E-192.00E-05 -0.000608211NA NA alpha.2 0

Re: [R] Add function to each row excluding certain columns

2013-10-09 Thread arun
Hi, No problem. It depends upon how many columns you want to delete, or if they have any common names as in "Restriction" example1<- as.matrix(read.table("example1.txt",header=TRUE,stringsAsFactors=FALSE,sep="\t",row.names=1,check.names=FALSE)) indx<- which(!grepl("Restriction", colnames(example

[R] Help required graphing factors with predicted model settings

2013-10-09 Thread Rebecca Stirnemann
Dear R wizards, Though I hate to do it after weeks of my code not working I need some help since I cant find an example which seems to work. I am trying to create a graph which show the probability of predation of a nest on one side (either 1 to 0) or (0% to 100%) on one side and grass height at t

Re: [R] Add function to each row excluding certain columns

2013-10-09 Thread laro
Thank you for the fast answer! Is there any way to use the first solution way, but work with the column names instead of the number of the column. Because in further calculation I need to drop more columns than just the restriction ones and the real dataset has to many columns to work with the pos

Re: [R] Add function to each row excluding certain columns

2013-10-09 Thread arun
Hi, Try: example1<- as.matrix(read.table("example1.txt",header=TRUE,stringsAsFactors=FALSE,sep="\t",row.names=1,check.names=FALSE)) example2 <- example1 example1New <- cbind(example1, `MAX without Restriction`=apply(example1[,1:4],1,max,na.rm=TRUE)) #or library(matrixStats) `MAX without Restrict

Re: [R] Formula documentation

2013-10-09 Thread Duncan Murdoch
On 13-10-09 8:11 AM, Data Analytics Corp. wrote: Hi, I recall that the form for an R formula statement has a formal name and a reference, perhaps in the computer science area. I'm referring to a statement such as Y ~ x1 + x2 + x3. Does anyone know the name for this form and where it came from?

[R] Using "cpquery" function from bnlearn package inside loop

2013-10-09 Thread Ryan Morrison
Hi everyone, I'm attempting to use the bnlearn package to calculate conditional probabilities, and I'm running into a problem when the "cpquery" function is used within a loop. I've created an example, shown below, using data included with the package. When using the cpquery function in a loop

Re: [R] select unique by multiple values

2013-10-09 Thread Bert Gunter
On Wed, Oct 9, 2013 at 11:49 AM, Berend Hasselman wrote: > > On 09-10-2013, at 13:50, Ronald Peterson wrote: > >> Hi, >> >> New to R here. Lots of fun. Still rather green though. >> >> I'd like to select unique items from a list that looks like this (for >> example): >> >>> xyz >> $x >> [1] 8 6

Re: [R] select unique by multiple values

2013-10-09 Thread Ronald Peterson
Very cool! Thanks Berend and arun. R. On Wed, Oct 9, 2013 at 2:49 PM, Berend Hasselman wrote: > > On 09-10-2013, at 13:50, Ronald Peterson wrote: > > > Hi, > > > > New to R here. Lots of fun. Still rather green though. > > > > I'd like to select unique items from a list that looks like thi

Re: [R] frailtypack

2013-10-09 Thread cf2059
Thank you very much for responding. Yes, I incorrectly stated that frailtypack was the only widely available software for the analysis of nested frailty models.When I initially began my search to identify software well suited to nested frailty analysis, Frailtypack dominated the google results

Re: [R] select unique by multiple values

2013-10-09 Thread Ronald Peterson
Thanks. That's not quite what I'm looking for, but it's good see different ways to slice and dice data. In my example, the one duplicated x,y pair would 9,9, so I would want to reduce the original list to > xyz $x [1] 8 6 9 0 0 3 9 7 1 $y [1] 1 2 9 5 1 2 0 9 2 $z [1] 5 6 9 0 5 1 1 7 3 and if

[R] habitat mapping of sharks

2013-10-09 Thread Lauria, Valentina
Dear All, I am trying to model the habitat mapping of 4 sharks species and my data are zero inflated and positively skewed. The zero percentages in my data vary between 56-77%. I did some tests fitting GAMs with negative binomial family (with theta between 1-10). Is this the best way to go? So

[R] Small p from binomial probability function.

2013-10-09 Thread Benjamin Ward (ENV)
Hi, I got given some code that uses the R function pbionom: p <- mut * t sumprobs <- pbinom( N, B, p ) * 1000 Which gives the output of a probability as a percentage like 5, 50, 95. What the code currently does is find me the values of t I need, by using the above two code lines in a loop, eac

[R] Using "cpquery" function from bnlearn package inside loop

2013-10-09 Thread Ryan Morrison
Hi everyone, I'm attempting to use the bnlearn package to calculate conditional probabilities, and I'm running into a problem when the "cpquery" function is used within a loop. I've created an example, shown below, using data included with the package. When using the cpquery function in a loop

[R] Formula documentation

2013-10-09 Thread Data Analytics Corp.
Hi, I recall that the form for an R formula statement has a formal name and a reference, perhaps in the computer science area. I'm referring to a statement such as Y ~ x1 + x2 + x3. Does anyone know the name for this form and where it came from? I would like to use this in a presentation I

Re: [R] select unique by multiple values

2013-10-09 Thread Berend Hasselman
On 09-10-2013, at 13:50, Ronald Peterson wrote: > Hi, > > New to R here. Lots of fun. Still rather green though. > > I'd like to select unique items from a list that looks like this (for > example): > >> xyz > $x > [1] 8 6 9 0 0 3 9 7 1 9 > $y > [1] 1 2 9 5 1 2 0 9 2 9 > $z > [1] 5 6 9 0 5

Re: [R] select unique by multiple values

2013-10-09 Thread arun
Hi, May be this is what you are looking for. indx<- xyz[[1]]==xyz[[2]] indx1<- which(indx)[duplicated(xyz[[1]][indx])] lapply(xyz,function(u) u[-indx1]) $x [1] 8 6 9 0 0 3 9 7 1 $y [1] 1 2 9 5 1 2 0 9 2 $z [1] 5 6 9 0 5 1 1 7 3  lapply(xyz, function(u) u[indx1]) $x [1] 9 $y [1] 9 $z [1] 4 A.

Re: [R] iconv question: SQL Server 2005 to R

2013-10-09 Thread Ira Sharenow
Thanks for everyone’s feedback. It may be that the person who is using SQL Server 2005 is doing something that is not helpful. In the data there are supposed to be 10 columns with headers. The first column is a date time that I was reading in as a string. The second is a string. The rest are

Re: [R] How can I use the predict function in R in a logistic regression fitted years ago?

2013-10-09 Thread Greg Snow
You can create a glm fit with only an offset created from the coefficients that you have, then use the regular predict function with that. For example using the iris data (first fitting a model on the real data, then fitting a new model using dummy data and the coefficients from the first fit): f

Re: [R] frailtypack

2013-10-09 Thread Terry Therneau
I can't comment on frailtypack issues, but would like to mention that coxme will handle nested models, contrary to the statement below that "frailtypack is perhaps the only for nested survival data". To reprise the original post's model cgd.nfm <- coxme(Surv(Tstart, Tstop, Status) ~ Tre

Re: [R] select unique by multiple values

2013-10-09 Thread arun
Hi, Not sure about your expected output. xyz<- list(x=c(8,6,9,0,0,3,9,7,1,9),y=c(1,2,9,5,1,2,0,9,2,9),z=c(5,6,9,0,5,1,1,7,3,4)) indx<-sort(unique(unlist(lapply(xyz[1:2],function(u) which(!duplicated(u))),use.names=FALSE)))  xyz[1:2]<-lapply(xyz[1:2],function(u) u[!duplicated(u)])  xyz[3]$z<-

Re: [R] Remove the help information when R console starts

2013-10-09 Thread arun
Hi, Check this link (not tested): http://stackoverflow.com/questions/7771577/clear-startup-screen-in-r-rstudio A.K. I just want to remove the help information when I start R console. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/

Re: [R] Latin Hypercube Sample and transformation to uniformly distributed integers or classes

2013-10-09 Thread Rob Carnell
Johannes Radinger gmail.com> writes: > > Hi, > > I'd like to use Latin Hypercube Sampling (LHC) in the the context of > uncertainty / sensitivity analysis of a complex model with approximately 10 > input variables. With the LHC approach I'd like to generate parameter > combinations for my mode

Re: [R] Correlating data after changing one observation for one variable

2013-10-09 Thread arun
Hi, trees <-  structure(list(Girth = c(8.3, 8.6, 8.8, 10.5, 10.7, 10.8, 11, 11, 11.1, 11.2, 11.3, 11.4, 11.4, 11.7, 12, 12.9, 12.9, 13.3, 13.7, 13.8, 14, 14.2, 14.5, 16, 16.3, 17.3, 17.5, 17.9, 18, 18, 20.6), Height = c(70L, 65L, 63L, 72L, 81L, 83L, 66L, 75L, 80L, 75L, 79L, 76L, 76L, 69L, 75L,

Re: [R] parallels package -can't create cluster

2013-10-09 Thread Carl Witthoft
Never mind -- after getting detailed help at SO, I rebooted Windows and makeCluster() worked just fine. I have no idea what cruft in my system was getting in the way, but all's well. -- View this message in context: http://r.789695.n4.nabble.com/parallels-package-can-t-create-cluster-tp46

[R] lme slopes and intercepts differences

2013-10-09 Thread Cleber Chaves
Hello all, I need to infer if the slopes and intercept of each group of my lme analyze, showed below, are different from each other. Like a Tukey test. I don't need to compare the slope and interceptof each subject of my fixed data, but the slope and intercept of each group of them. > m1<-lme(fvf

Re: [R] How can I use the predict function in R in a logistic regression fitted years ago?

2013-10-09 Thread S Ellison
> Suppose that you have a logistic equation regression (binary model) from an > old model that you estimated some years ago. Therefore you know the > parameters âk (k = 1, 2, ..., p) because they were estimated in the > past. > But you don't have the data that were used to fit the model. > > My

[R] select unique by multiple values

2013-10-09 Thread Ronald Peterson
Hi, New to R here. Lots of fun. Still rather green though. I'd like to select unique items from a list that looks like this (for example): > xyz $x [1] 8 6 9 0 0 3 9 7 1 9 $y [1] 1 2 9 5 1 2 0 9 2 9 $z [1] 5 6 9 0 5 1 1 7 3 4 I'd like to select unique (x,y), while preserving association wi

[R] Error while running MR using rmr2

2013-10-09 Thread Praveen Sripati
Hi, I have trying to run a simple MR program using rmr2 in a single node Hadoop cluster. Here is the environment for the setup Ubuntu 12.04 (32 bit) R (Ubuntu comes with 2.14.1, so updated to 3.0.2) Installed the latest rmr2 and rhdfs from here

[R] Dutilleul's method with covarying parameters

2013-10-09 Thread Joey Talbot
Hi, I have a set of parameters that I want to test for covariance using Spearman's correlation coefficient. >cor.test(x=x,y=y,method="spearman") These parameters are taken from plots which may be spatially correlated. How can I use Dutilleul's method to account for spatial autocorrelation whil

[R] How to write R data frame to HDFS using rhdfs?

2013-10-09 Thread Gaurav Dasgupta
Hello, I am trying to write the default "OrchardSprays" R data frame into HDFS using the "rhdfs" package. I want to write this data frame directly into HDFS without first storing it into any file in local file system. Which rhdfs command i should use? Can some one help me? I am very new to R and

[R] [R-pkgs] A new version of the package “TestSurvRec” is now available on CRAN

2013-10-09 Thread Carlos M. Martinez Manrique
Dear useRs, A new version of the package “TestSurvRec” is now available on CRAN. In this version I add new function and new data of recurrent events. The new function called “Plot.Data.Events” plots recurrent event data and the new data is useful as example for see the functional

Re: [R] mixed model MANOVA? does it even exist?

2013-10-09 Thread laurie bayet
Hi Peter, and thank you for your quick and helpful reply ! "Do you want to know whether the predictors affect the marginal distributions of Y1, Y2,... or are you interested in conditional effects given other DVs (aka test for additional information)?" Hmmm I think that, yes, i am looking for that

[R] How can I use the predict function in R in a logistic regression fitted years ago?

2013-10-09 Thread Pedro Carmona Ibáñez
I have a problem that I am trying to resolve with no success. More than two days searching and I didn't get a single clue. Sorry if the answer is out there and I didn't find it. Suppose that you have a logistic equation regression (binary model) from an old model that you estimated some years ago.

[R] Testing.

2013-10-09 Thread Rolf Turner
Please ignore. My apologies for the noise. cheers, Rolf Turner __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minim

Re: [R] iconv question: SQL Server 2005 to R

2013-10-09 Thread Milan Bouchet-Valat
Le mardi 08 octobre 2013 à 16:02 -0700, Ira Sharenow a écrit : > A colleague is sending me quite a few files that have been saved with MS > SQL Server 2005. I am using R 2.15.1 on Windows 7. > > I am trying to read in the files using standard techniques. Although the > file has a csv extension w

[R] how to pairs plot without axes

2013-10-09 Thread Witold E Wolski
In the pairs help is an example how to plot the correlation as txt. How do I get rid of the axes in the upper panel? regards ## put (absolute) correlations on the upper panels, ## with size proportional to the correlations. panel.cor <- function(x, y, digits = 3, prefix = "", cex.cor,axis=F, ..

Re: [R] mixed model MANOVA? does it even exist?

2013-10-09 Thread peter dalgaard
As a matter of principle, yes, multivariate mixed models do exist, look at the last bit of example(manova) (in reasonably recent versions of R). In practice, it often doesn't really buy you much. It just gives a joint test for all the DVs, the estimates are the same as in separate analyses. Th

Re: [R] iconv question: SQL Server 2005 to R

2013-10-09 Thread Prof Brian Ripley
'Unicode' is a not an encoding. As the help says fileEncoding: character string: if non-empty declares the encoding used on a file (not a connection) so the character data can be re-encoded. See the ‘Encoding’ section of the help for ‘file’, the ‘R Data Import/Expo

[R] mixed model MANOVA? does it even exist?

2013-10-09 Thread laurie bayet
Hi, Sorry to bother you again. I would like to estimate the effect of several categorical factors (two between subjects and one within subjects) on two continuous dependent variables that probably covary, with subjects as a random effect. *I want to control for the covariance between those two D