Description Usage Arguments Value
Calculates column totals for a set of columns in a dataframe and returns
them as a vector. Use add_col_totals
to append the column
percentages to the input dataframe.
1 2 3 4 5 6 7 |
data |
A dataframe containing columns of numerical data to be summed by column. |
from |
The number or name of the column from which column totals are calculated. The default is 2, assuming one column for row labels. Use 1 if there are no preceding data columns. |
to |
The number or name of the column to which column totals are calculated. The default is ncol(data), which means column totals are calculated across all remaining columms in the dataframe. |
rows |
A numeric vector of the rows to be summed. The default is all rows in the dataframe. |
na.rm |
A boolean which if TRUE ignores NAs in calculating totals. The default value is FALSE. |
A numeric vector of column totals.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.