Re: [R] question about string to boor?

2011-10-10 Thread Christoph Molnar
Hi Nellie, hope I got you right. I guess you want something like that. for (i in 1:7) { oneOfNelliesArray <- eval(parse(text=paste("grp",i, sep=""))) anyFunction(oneOfNelliesArray) } Paste() just returns you a string. But you want R to evaluate the expression. So you have to parse it and t

Re: [R] p adjustment on 4thcorner results

2011-10-12 Thread Christoph Molnar
Hi, ?p.adjust Christoph 2011/10/12 Cristina Ramalho > Hi all, > > This is probably a very simple question but I cannot figure out how to do > it. I run the fourthcorner method with my data and would like to adjust the > p values for multiple comparisons using Holm correction. When I run the >

Re: [R] p adjustment on 4thcorner results

2011-10-12 Thread Christoph Molnar
ead.table("woody.txt", sep="\t", head=T, row.names = 1) > woodyadj = p.adjust(woody$p, method = "holm") > > My question is how to do the correction directly on the results of > 4thcorner? Or, another way, how can I convert the 4th corner results in a > data matri

Re: [R] Applying function to only numeric variable (plyr package?)

2011-10-12 Thread Christoph Molnar
Hi, if the rows in your data.frame are numeric, this solution will work. (numeric.index <- unlist(lapply(df, is.numeric))) df[, numeric.index] <- apply(df[,numeric.index], 2, pct) This does not work for the example you gave, unless you coerce the columns with the your numerics to numeric: c1 <- c

Re: [R] Help in kmeans

2011-10-16 Thread Christoph Molnar
Hi, I suspect your column Species is of class "factor" (as it is in R's built in iris dataset). This means that in your case Species is an integer vector with the additional information of the levels names. kmeans is internally calling as.matrix(), which creates a character matrix of your datafram

Re: [R] Help in kmeans

2011-10-16 Thread Christoph Molnar
*. > For example,a column which contains names like country names.How does this > work in such cases? Is it expected behavior? > > Country > --- > England > Germany > China > > Thanks, > Raji > > > On Mon, Oct 17, 2011 at 1:02 AM, Christoph Molna