View source: R/table_summary.R
table_summary | R Documentation |
This is a wrapper around aggregate
function in base R to obtain mean, median, standard deviation and count for quantitative variable(s) grouped by one or more factors. More than one column containing of quantitative variables can be passed on, and summaries for each is provided with column names with a .
.
table_summary(data, Ycol, ByGroup)
data |
name of the data table. |
Ycol |
name of one column (in quotes) or a vector of column names containing the numerical variable to be summarised. |
ByGroup |
name of one column (in quotes) or a vector of column names containing the grouping factors |
this function takes in a data.frame or tibble and returns a data.frame or tibble.
table_summary(Ycol = "cty",
ByGroup = c("fl", "drv"),
data = mpg)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.