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.set,.(site),mean) means site x y 1 1 -97459496 -0.14826303 2 2 -150246922 -0.29279556 3 3 471813178 0.13090210 4 4 -655451621 0.07908207 5 5 -229505843 0.10239588 6 6 -667025397 -0.34930275 7 7 510041943 0.20547460 8 8 270993292 -0.63658199 9 9 264989314 0.09695455 10 10 -199965142 -0.07202699 maxes<-ddply(test.set,.(site),max) maxes site V1 1 1 1942437227 2 2 2066224792 3 3 2146619846 4 4 1381954134 5 5 1802867123 6 6 1786627153 7 7 1951106534 8 8 1498358582 9 9 2022046126 10 10 1670904926 Can you all shed some light on this? I'm stumped! Thanks, Justin ______________________________________________ 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 commented, minimal, self-contained, reproducible code.