View source: R/summarize_cat_cat_data.R
| summarize_cat_cat_data | R Documentation |
Summarize a survey dataset for use in tables and graphs
summarize_cat_cat_data(
data,
dep = colnames(data),
indep = NULL,
...,
showNA = c("ifany", "always", "never"),
totals = FALSE,
sort_by = ".upper",
sort_dep_by = NULL,
sort_indep_by = ".factor_order",
data_label = c("percentage_bare", "percentage", "proportion", "count", "mean",
"median"),
digits = 0,
add_n_to_dep_label = FALSE,
add_n_to_indep_label = FALSE,
add_n_to_label = FALSE,
add_n_to_category = FALSE,
hide_label_if_prop_below = 0.01,
data_label_decimal_symbol = ".",
categories_treated_as_na = NULL,
label_separator = NULL,
descend = FALSE,
descend_indep = FALSE,
labels_always_at_bottom = NULL,
labels_always_at_top = NULL,
translations = list(),
call = rlang::caller_env()
)
data |
Your data.frame/tibble or srvyr-object (experimental)
The data to be used for plotting. |
dep, indep |
Variable selections < Columns in |
... |
Dynamic dots Arguments forwarded to the corresponding functions that create the elements. |
showNA |
Show NA categories
Choose whether to show NA categories in the results. |
totals |
Include totals
Whether to include totals in the output. |
sort_by |
What to sort output by (legacy)
DEPRECATED: Use
|
sort_dep_by |
What to sort dependent variables by
Sort dependent variables in output. When using
|
sort_indep_by |
What to sort independent variable categories by
Sort independent variable categories in output. When
|
data_label |
Data label
One of "proportion", "percentage", "percentage_bare", "count", "mean", or "median". |
digits |
Decimal places
Number of decimal places. |
add_n_to_dep_label, add_n_to_indep_label |
Add N= to the variable label
For some plots and tables it is useful to attach the |
add_n_to_label |
Add N= to the variable label of both dep and indep
For some plots and tables it is useful to attach the |
add_n_to_category |
Add N= to the category
For some plots and tables it is useful to attach the |
hide_label_if_prop_below |
Hide label threshold
Whether to hide label if below this value. |
data_label_decimal_symbol |
Decimal symbol
Decimal marker, some might prefer a comma ',' or something else entirely. |
categories_treated_as_na |
NA categories
Categories that should be treated as NA. |
label_separator |
How to separate main question from sub-question
Separator for main question from sub-question. |
descend |
Sorting order
Reverse sorting of |
descend_indep |
Sorting order for independent variables
Reverse sorting of |
labels_always_at_top, labels_always_at_bottom |
Top/bottom variables
Column names in |
translations |
Localize your output
A list of translations where the name is the code and the value is the translation. See the examples. |
call |
Internal call
Both the absolute and relative folderpaths are required, as strings. |
Dataset with the columns: .variable_name, .variable_label, .category,
.count, .count_se, .count_per_dep, .count_per_indep_group, .proportion, .proportion_se,
.mean, .mean_se, .median, indep-variable(s), .data_label, .comb_categories, .sum_value,
.variable_label_prefix
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.