Re: [R] aggregate(...) with multiple functions

2010-07-16 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 16.07.2010 05:02:52: > On Thu, Jul 15, 2010 at 10:45 PM, Murat Tasan wrote: > > hi all - i'm just wondering what sort of code people write to > > essentially performa an aggregate call, but with different functions > > being applied to the various column

Re: [R] aggregate(...) with multiple functions

2010-07-15 Thread Dennis Murphy
Hi: A nice package for doing this sort of thing is doBy. Let's manufacture an example since you didn't provide one: set.seed(126) d <- data.frame(g = rep(letters[1:3], each = 10), x1 = rnorm(30), x2 = rnorm(30, mean = 5), x3 = rnorm(30, mean = 10

Re: [R] aggregate(...) with multiple functions

2010-07-15 Thread Gabor Grothendieck
On Thu, Jul 15, 2010 at 10:45 PM, Murat Tasan wrote: > hi all - i'm just wondering what sort of code people write to > essentially performa an aggregate call, but with different functions > being applied to the various columns. > > for example, if i have a data frame x and would like to marginaliz

Re: [R] aggregate(), with multiple functions in FUN?

2008-05-17 Thread david f
You might want to look at the summaryBy function in the doBy package summaryBy(varname ~ zip, data=DATA,FUN=c(mean,median) David Freedman Mike ! wrote: > > > > I've got a data frame having numerical data by zip code: > > ZIP DATA > 94111 12135.545 > 93105 321354.65654 > 941

Re: [R] aggregate(), with multiple functions in FUN?

2008-05-16 Thread jim holtman
Will something like this work for you: > d <- read.table(textConnection("ZIP DATA + 94111 12135.545 + 93105 321354.65654 + 94111 545.555 + 94706 558858.66"), header=TRUE) > closeAllConnections() > aggregate(d$DATA, list(Zip = d$ZIP), FUN=median, na.rm=T) Zip x 1