colSums2 | R Documentation |
calculate column sums for all columns, returning NA for columns that won't coerce to numeric
colSums2(df, remove_non_numeric = F, na.rm = T)
df |
a data frame with columns to sum |
remove_non_numeric |
a logical value determing whether or not NA values (ie. columns that cannot be cooreced to numeric and therefore won't sum) should be removed from the returned results |
na.rm |
a logical value determining if NA values should be ignored when summing |
a one-row data frame with the sum of each column. Columns that cannot be summed return NA unless remove_non_numeric=T
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.