Given this data set:
Name Height Weight
1 Mary 65 110
2 John 70 200
3 Jane 64 115
I\'d like to sum every qualifier c
We can use dplyr to select only numeric columns and purr to get sum for all columns. (can be used to get what ever value for all columns, such as mean, min, max, etc. )
library("dplyr")
library("purrr")
people %>%
select_if(is.numeric) %>%
map_dbl(sum)
Or another easy way by only using dplyr
library("dplyr")
people %>%
summarize_if(is.numeric, sum, na.rm=TRUE)