Description Usage Arguments Author(s) Examples
This function returns a new dataframe with its last row being the column sums of the original dataframe. Note that the first column of the input dataframe must be of character type.
1 | get_col_sums_added(a_df, desc_of_row = "Total")
|
a_df |
A dataframe. |
desc_of_row |
Description of the row, and the default value is 'Total'. |
Lingyun (Larry) Zhang lyzhang10@gmail.com
1 2 3 4 5 6 7 8 | df <-
data.frame(x = letters[1:10],
y = 1,
z = 2,
w = rnorm(10),
stringAsFactor = FALSE)
df_with_col_sums <- get_col_sums_added(df)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.