Compare the distribution of a target variable vs another variable. This function automatically splits into quantiles for numerical variables. Custom and tidyverse friendly.
distr(data, ..., type = 1, top = 10, breaks = 10, na.rm = FALSE,
force = "none", trim = 0, clean = FALSE, abc = FALSE,
custom_colours = FALSE, results = FALSE, save = FALSE,
subdir = NA)
Dataframe
Variables. Main (target variable) and secondary (values variable) to group by
Integer. 1 for both plots, 2 for counter plot only, 3 por percentages plot only.
Integer. Filter and plot the most n frequent for categorical values
Integer. Number of splits for numerical values
Boolean. Ignore NAs if needed
Character. Force class on the values data. Choose between 'none', 'character', 'numeric', 'date'
Integer. Trim labels until the nth character for categorical values (applies for both, target and values)
Boolean. Use lares::cleanText for categorical values (applies for both, target and values)
Boolean. Do you wish to sort by alphabetical order?
Boolean. Use custom colours function?
Boolean. Return results data.frame?
Boolean. Save the output plot in our working directory
Character. Into which subdirectory do you wish to save the plot to?