> Thats the ticket! So mean is already set up to operate on columns but max and
> min are not? I guess its not too important now I know ... but whats going on
> in
> the background that makes that happen?
Basically, this:
> mean.data.frame
function (x, ...)
sapply(x, mean, ...)
> min.data.fra
That's beyond my knowledge of plyr...S
On Wednesday, May 11, 2011 at 12:31 PM, Justin wrote:
> Scott Chamberlain gmail.com> writes:
>
> >
> > How about this:
> >
> > ddply(test.set, .(site), colwise(max))
> > On Wednesday, May 11, 2011 at 11:46 AM, Justin wrote:
> > > test.set<-data.frame(sit
Hi:
Try this:
test.set<-data.frame(site=1:10,x=.Random.seed[1:100],y=rnorm(100))
str(test.set)
'data.frame': 100 obs. of 3 variables:
$ site: int 1 2 3 4 5 6 7 8 9 10 ...
$ x : int 403 10 -74327032 10380982 -951011855 1368411171
-390937486 -1081698620 -812257145 -1354214307 ...
$ y :
Scott Chamberlain gmail.com> writes:
>
> How about this:
>
> ddply(test.set, .(site), colwise(max))
> On Wednesday, May 11, 2011 at 11:46 AM, Justin wrote:
> > test.set<-data.frame(site=1:10,x=.Random.seed[1:100],y=rnorm(100))
> > means<-ddply(test.set,.(site),mean)
> > means
>
> [[alt
How about this:
ddply(test.set, .(site), colwise(max))
On Wednesday, May 11, 2011 at 11:46 AM, Justin wrote:
> test.set<-data.frame(site=1:10,x=.Random.seed[1:100],y=rnorm(100))
> means<-ddply(test.set,.(site),mean)
> means
[[alternative HTML version deleted]]
I'm trying to use ddply to compute summary statistics for many variables
splitting on the variable site. however, it seems to work fine for mean() but
if i use max() or min() things fall apart. whats going on?
test.set<-data.frame(site=1:10,x=.Random.seed[1:100],y=rnorm(100))
means<-ddply(test
6 matches
Mail list logo