Learn R Programming

lares (version 4.7)

freqs: Frequencies Calculations and Plot

Description

This function lets the user group, count, calculate percentages and cumulatives. It also plots results if needed. Tidyverse friendly.

Usage

freqs(df, ..., wt = NULL, rel = FALSE, results = TRUE,
  variable_name = NA, plot = FALSE, rm.na = FALSE, title = NA,
  subtitle = NA, top = 20, abc = FALSE, save = FALSE,
  subdir = 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

wt

Variable, numeric. Weights.

rel

Boolean. Relative percentages (or absolute)?

results

Boolean. Return results in a dataframe?

variable_name

Character. Overwrite the main variable's name

plot

Boolean. Do you want to see a plot? Three variables tops.

rm.na

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

title

Character. Overwrite plot's title with.

subtitle

Character. Overwrite plot's subtitle with.

top

Integer. Filter and plot the most n frequent for categorical values. Set to NA to return all values

abc

Boolean. Do you wish to sort by alphabetical order? If set to FALSE then frequency will sort the values

save

Boolean. Save the output plot in our working directory

subdir

Character. Into which subdirectory do you wish to save the plot to?

See Also

Other Exploratory: corr_cross, corr_var, crosstab, df_str, distr, freqs_df, gain_lift, get_tweets, missingness, plot_cats, plot_df, plot_nums, tree_var, trendsRelated

Other Visualization: corr_plot, distr, freqs_df, mplot_conf, mplot_cuts_error, mplot_cuts, mplot_density, mplot_full, mplot_gain, mplot_importance, mplot_lineal, mplot_metrics, mplot_response, mplot_roc, mplot_splits, noPlot, plot_survey, theme_lares2, theme_lares, tree_var