Description Usage Arguments Value Author(s) Examples
View source: R/plot_discrete_vars.R
Creates a grid of bar plots for variables with at most
nvalues
(15 is the default) different values.
1 | plot_discrete_vars(x, nvalues = 15, sort_by_frequency = FALSE)
|
x |
Data frame, tibble or matrix with data. |
nvalues |
Integer. It creates a bar plot for each variable with at most this amount of different values. The default value is 15. |
sort_by_frequency |
Logical. It casts every variable to factor and then reorders the levels by frequency before generating the plot. |
A GGplot object.
Guillermo Basulto-Elias
1 2 3 4 5 6 7 8 9 10 | library(glancedata)
plot_discrete_vars(mtcars)
plot_discrete_vars(mtcars, sort_by_frequency = TRUE)
plot_discrete_vars(iris)
## The following two examples give a warning because they don't
## have any variable with fewer than 15 different values.
plot_discrete_vars(cars)
plot_discrete_vars(state.x77)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.