Description Usage Arguments Value References Examples
View source: R/summarize_data.R
This function computes summary statistics on a numeric variable grouped by a categorical variable. The summary statistics include mean, median, minimum, maximum, and count.
1 | summarize_data(df, x, y, na.rm = TRUE)
|
df |
Tibble or data frame containing variables for computing summary statistics. Name is easily recognizable. |
x |
A categorical variable by which rows are grouped. It is named x because it is more generally used and easy to identify. |
y |
A numeric variable for computing summary statistics. It is named y because it is more generally used and easy to identify. |
na.rm |
A logical value that gives the option to either remove or retain missing values. It is a generally used argument to specify whether or not to remove missing values. |
A list object with 2 items: a tibble or data frame and a ggplot object- boxplot.
Syntax suggested on StackOverflow by Gabra https://stackoverflow.com/questions/40102613/ggplot2-adding-sample-size-information-to-x-axis-tick-labels https://dplyr.tidyverse.org/articles/programming.html
1 2 | summarize_data(gapminder::gapminder, continent, lifeExp)
summarize_data(datateachr::cancer_sample, diagnosis, perimeter_mean)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.