View source: R/plot_density_helpers.R
calc_density | R Documentation |
Internal helper function that is called in plot_density
to
calculate the density of a metric variable. If plot_density
is called
from within plot_densityMatrix
(i.e., when some of the columns
c("age_group","period_group","cohort_group")
are part of the dataset,
the density is computed individually for all respective APC groups.
calc_density(dat, y_var, weights_var = NULL, ...)
dat |
Dataset with columns |
y_var |
Character name of the main variable to be plotted. |
weights_var |
Optional character name of a weights variable used to project the results in the sample to some population. |
... |
Additional arguments passed to |
Dataset with the calculated densities.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.