apply-type function for data frames
An apply-type function for data frames.
dfapply(data, FUN, select = TRUE, ...)
data |
data frame |
FUN |
a function to apply to (some) variables in the data frame |
select |
a logical, character (naming variables), or numeric vector or a
function used to select variables to which |
... |
arguments passed along to |
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))
}Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.