Hi, suppose I have a data frame as below:
dat-cbind(expand.grid(id=c(1,2,3),time=c(0,3,6),mode=c('R','L'),rep=(1:3)),y=rnorm(54))
I kind of want to squeeze the data frame into a new one with averaged y
over
rep for the same id, time and mode. taking average is easy with tapply:
tapply(dat$y,
On Sep 9, 2010, at 5:47 PM, array chip wrote:
Hi, suppose I have a data frame as below:
dat-
cbind
(expand
.grid
(id=c(1,2,3),time=c(0,3,6),mode=c('R','L'),rep=(1:3)),y=rnorm(54))
I kind of want to squeeze the data frame into a new one with
averaged y over
rep for the same id, time
: r-help@r-project.org
Sent: Thu, September 9, 2010 3:21:15 PM
Subject: Re: [R] sequeeze a data frame
On Sep 9, 2010, at 5:47 PM, array chip wrote:
Hi, suppose I have a data frame as below:
dat-cbind(expand.grid(id=c(1,2,3),time=c(0,3,6),mode=c('R','L'),rep=(1:3)),y=rnorm(54))
)
I kind
...@comcast.net
To: array chip arrayprof...@yahoo.com
Cc: r-help@r-project.org
Sent: Thu, September 9, 2010 3:21:15 PM
Subject: Re: [R] sequeeze a data frame
On Sep 9, 2010, at 5:47 PM, array chip wrote:
Hi, suppose I have a data frame as below:
dat-
cbind(expand.grid(id=c(1,2,3),time=c(0,3,6
Subject: RE: [R] sequeeze a data frame
Tena koe John
?aggregate
maybe?
HTH
Peter Alspach
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-
project.org] On Behalf Of array chip
Sent: Friday, 10 September 2010 11:13 a.m.
To: David Winsemius
Cc: r
5 matches
Mail list logo