> # 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