Description Usage Arguments Value Examples
View source: R/aggregate_columns.R
Multiple columns are added together, or the mean is taken to create a new columns. Used can also choose to delete the original columns.
1 | aggregate_columns(x, columns, new_colname, mode = "sum", delete = FALSE)
|
x |
Any nonempty dataframe. |
columns |
Names of the columns to be aggregated. |
new_colname |
How to name the new columns |
mode |
Choose "sum" to take sum, or "mean" to take the mean. |
delete |
Choose TRUE to drop the original rows from the dataframe, or FALSE to retain them. |
Returns the dataframe with the new column included.
1 | aggregate_columns(mtcars, c("vs", "cyl", "mpg"), "meaningless_mean", mode = "mean")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.