avg_dataframe | R Documentation |
Average a dataframe with continuous and discrete variables columnwise.
avg_dataframe(
df,
group_by = 1,
rows_to_keep = NULL,
cols_to_keep = NULL,
sort_cols = FALSE
)
df |
A data frame to average across. Note: Only numeric columns will be averaged, while discrete columns will retain the first instance for each group. |
group_by |
Name or column of index to average valuesby. |
rows_to_keep |
Numeric, logical or character vectors of rows to keep in subset (length must be number of rows of df). Note: character for named rows only |
cols_to_keep |
Numeric, logical or character vectors of columns to keep in subset (length must be number of columns of df). Note: character for named columns only |
sort_cols |
logical, should we sort columns alphabetically? |
A data frame averaged column by column.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.