View source: R/combine_topline_multiselect.R
| combine_topline_multiselect | R Documentation |
apply_topline_multiselect()This function completes the split-apply-combine workflow in handling multiple selection questions
in the survey. This is a helper function that accepts the output of apply_topline_multiselect() containing two
lists— return and error. It will either 1) throw an error indicating that attention must be paid to
the error list, or 2) return a single list of toplines, which can then be passed to print_tbls().
combine_topline_multiselect(l)
l |
A list of lists as returned by |
A list of flextable objects.
# Vector of patterns
patterns <- c("prefix_1", "predix_2", ...)
# List of data.tables
list_df <- split_df(df, patterns, "weight_var")
# Apply topline generation to each element of 'list_df'
captions <- list(c("caption_parent", "caption_child"), "caption_2", ...)
parents <- c(TRUE, FALSE, ...)
results <- apply_topline_multiselect(list_df, "weight_var", captions, parents)
# Combine the results
list_of_toplines <- combine_topline_multiselect(l = results)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.