[R] How to compute within-group mean and sd?

2012-03-24 Thread reeyarn
it easier? Thanks :) Best, Reeyarn Lee [[alternative HTML version deleted]] __ 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

Re: [R] How to compute within-group mean and sd?

2012-03-25 Thread reeyarn
Thanks Rui, Greg, and Michael. Your answers helped a lot! Best, Reeyarn On Sun, Mar 25, 2012 at 1:02 AM, Rui Barradas wrote: > Hello, > > > You can use sql with package 'sqldf'. > library(sqldf) # It needs package 'tcltk' > ?sqldf > tbl <- data.f

Re: [R] subset problem

2012-03-28 Thread reeyarn
t[1], ] for (type1 in type_list[ 2: length (type_list) ] ) { mysubset<-cbind (mysubset, df [ df$type == type1, ]) } What is the natural way of doing this in R? Is it possible to use subset() to attain this? Thanks! Best, Reeyarn On Fri, Dec 3, 2010 at 11:26 AM,  William Dunlap <

Re: [R] subset problem

2012-03-30 Thread reeyarn
Thank you so much, Peter and Andrija :) On Thu, Mar 29, 2012 at 1:44 PM, peter dalgaard wrote: > %in% is your friend > mysub <- subset(df, type %in% type_list, select=c(name,type)) > or > mysub <- df[df$type %in% type_list, c("name","type")] > The latter is slightly safer if you can't be sure tha