dplyr::summarise column names that are numbers. Apply sum
summarise_numeric <- function(df, fun) { num_cols <- sapply(df, is.numeric) df[, num_cols] %>% summarise_all(fun) } dplyr::summarise(iris, mean = mean(Sepal.Length), sd = sd(Sepal.Length)) summarise_numeric(iris, mean) summarise_numeric(iris, sd)