> # Then try one of these: > > cast(dfm, year ~ sim) > cast(dfm, year + sim ~ . ) > cast(dfm, year ~ sim, margins=TRUE)
Oops that should be: dfm <- rename(df, c(DensPlants = "value")) cast(dfm, year ~ sim, mean) cast(dfm, year + sim ~ . , mean) cast(dfm, year ~ sim, mean, margins=TRUE) (Thanks for pointing that out Gabor!) Hadley ______________________________________________ R-help@stat.math.ethz.ch 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.