View source: R/summary_observed.R
proportions_observed | R Documentation |
summary_observed
to observed values.Calculate the proportions of each level of a variable after applying
summary_observed
to observed values.
proportions_observed(obs_data, strata_vars, digits = 2)
obs_data |
A data frame containing the output from |
strata_vars |
A vector of column names identifying the variables to be used for stratification. |
digits |
Number of decimal places to round the results to. Default is 2. |
A data frame that contains the proportions after applying
summary_observed
.
local_dir <- system.file("extdata", "right", package = "verdata")
replicates_data <- read_replicates(local_dir, "reclutamiento", c(1, 2), version = "v1")
tab_observed <- summary_observed("reclutamiento", replicates_data,
strata_vars = "sexo", conflict_filter = TRUE, forced_dis_filter = FALSE,
edad_minors_filter = TRUE, include_props = TRUE)
prop_data <- proportions_observed(tab_observed, strata_vars = "sexo",
digits = 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.