Performs Chi-squared tests and generates proportional bar plots for categorical variables.
categorical_analyses(
data,
cat_vars,
output_dir,
palette_name = "Paired",
custom_colors = NULL
)A data frame with Chi-squared test results
Data frame containing the variables
Character vector of categorical variable names
Directory to save results
RColorBrewer palette name for categorical fills (default: "Paired")
Optional named vector of colors for species (not used for categorical fills)