Learn R Programming

lares (version 4.8.4)

freqs_plot: Combinated Frequencies Plot for Categoral Features

Description

Plot frequencies of multiple categories within a data.frame in a new fancy way. Tidyverse friendly, based on lares::freqs(), no limits on amount of features to evaluate.

Usage

freqs_plot(
  df,
  ...,
  top = 10,
  rm.na = FALSE,
  abc = FALSE,
  title = NA,
  subtitle = NA
)

Arguments

df

Data.frame

...

Variables. Variables you wish to process. Order matters. If no variables are passed, the whole data.frame will be considered

top

Integer. Filter and plot the most n frequent for values.

rm.na

Boolean. Remove NA values in the plot? (not filtered for numerical output; use na.omit() or filter() if needed)

abc

Boolean. Do you wish to sort by alphabetical order?

title

Character. Overwrite plot's title with.

subtitle

Character. Overwrite plot's subtitle with.

See Also

Other Frequency: freqs_df(), freqs_list(), freqs()

Other Exploratory: corr_cross(), corr_var(), crosstab(), df_str(), distr(), freqs_df(), freqs_list(), freqs(), lasso_vars(), missingness(), plot_cats(), plot_df(), plot_nums(), summer(), tree_var(), trendsRelated()

Other Visualization: distr(), freqs_df(), freqs_list(), freqs(), gg_bars(), gg_pie(), noPlot(), plot_chord(), plot_survey(), plot_timeline(), summer(), theme_lares2(), theme_lares(), tree_var()

Examples

Run this code
# NOT RUN {
options("lares.font" = NA) # Temporal
data(dft) # Titanic dataset

df <- freqs_plot(dft, Pclass, Survived)
head(df$data)
plot(df)

freqs_plot(dft, Pclass, Survived, Sex, Embarked)

freqs_plot(dft, Pclass, Survived, Sex, Embarked, top = 15)
# }

Run the code above in your browser using DataLab