dfapply(iris, mean, select = is.numeric)
dfapply(iris, mean, select = c(1,2))
dfapply(iris, mean, select = c("Sepal.Length", "Petal.Length"))
if (require(mosaicData)) {
dfapply(HELPrct, table, select = is.factor)
do.call(rbind, dfapply(HELPrct, mean, select = is.numeric))
}
Run the code above in your browser using DataLab