explore_count {explore} | R Documentation |
Explore count data (categories + frequency)
Description
Create a plot to explore count data (categories + freuency) Variable named 'n' is auto detected as Frequency
Usage
explore_count(
data,
cat,
n,
target,
pct = FALSE,
split = TRUE,
title = NA,
numeric = FALSE,
max_cat = 30,
max_target_cat = 5,
color = c("lightgrey", "#939FB9"),
flip = NA
)
Arguments
data |
A dataset (categories + frequency) |
cat |
Numerical variable |
n |
Number of observations (frequency) |
target |
Target variable |
pct |
Show as percent? |
split |
Split by target (FALSE/TRUE) |
title |
Title of the plot |
numeric |
Display variable as numeric (not category) |
max_cat |
Maximum number of categories to be plotted |
max_target_cat |
Maximum number of categories to be plotted for target (except NA) |
color |
Color for bar |
flip |
Flip plot? (for categorical variables) |
Value
Plot object
Examples
library(dplyr)
iris %>%
count(Species) %>%
explore_count(Species)
[Package explore version 1.3.1 Index]