categorical_col_chart: Plot Counts of Categorical Variables Create a ggplot2 column...

Description Usage Arguments Value Examples

View source: R/categorical_col_chart.R

Description

Plot Counts of Categorical Variables Create a ggplot2 column chart of categorical variables with proportions, in ascending order.

Usage

1
categorical_col_chart(df, grouping_var)

Arguments

df

A dataframe with categorical variables

grouping_var

a categorical variable by which to group the count by

Value

a ggplot2 object

Examples

1
2
3
4
5
6
7
8
library(SangerTools)
library(dplyr)
library(ggplot2)
# Group by Age Band
health_data <- SangerTools::PopHealthData
health_data %>%
 dplyr::filter(Smoker==1) %>%
 SangerTools::categorical_col_chart(AgeBand) + labs(x="Ethnicity", y="Patient Number")

ald0405/SangerTools documentation built on Jan. 14, 2022, 9:42 p.m.