Internal helper function to plot one metric density, to be called from within
plot_density
.
plot_density_metric(
dat,
y_var,
plot_type = "density",
dat_highlightDiagonals = NULL,
y_var_cat_breaks = NULL,
y_var_cat_labels = NULL,
weights_var = NULL,
log_scale = FALSE,
xlab = NULL,
ylab = NULL,
legend_title = NULL,
...
)
Dataset with columns period
and age
and the
main variable specified through argument y_var
.
Character name of the main variable to be plotted.
One of c("density","boxplot")
. Only used if the
y_var
column is metric.
Optional dataset created by
create_highlightDiagonalData
to highlight specific diagonals
in a density matrix.
Optional numeric vector of breaks to categorize
y_var
based on calling function cut
. Only used to
highlight the categories based on different colors. And only used if the
y_var
column is numeric.
Optional character vector for the names of the
categories that were defined based on y_var_cat_breaks
. The length of
this vector must be one shorter than length(y_var_cat_breaks)
. Only
used if the y_var
column is numeric.
Optional character name of a weights variable used to project the results in the sample to some population.
Indicator if the main variable should be log10 transformed.
Only used if the y_var
column is numeric. Defaults to FALSE.
Optional plot annotations.
Additional arguments passed to density
.