View source: R/T_hss_table_single.R
T_hss_table_single | R Documentation |
Create contingency tables for HSS questions with a single response option and a cross-variable. Tables can be created with either counts or percentages and the number of significant digits for percentages can be set. Tables created with this function come with a couple of additions according to HSS preferences. Most notably: sums are added over columns, and N-values are added to column headers.
T_hss_table_single(df, var, group, percent = TRUE, digits = 1)
df |
A dataframe containing the variable of interest and grouping variable. |
var |
A character string with the variable name of interest. |
group |
A character string with the grouping (or disaggregation) variable. |
percent |
Set to TRUE to show percentages. Set to FALSE to show counts. |
digits |
The number of (significant) digits to display. Trailing zeroes are always removed. Note that 'digits' does not mean 'decimals', so digits = 3 will display as 'mm.d' not 'mm.ddd' |
A contingency table with the variable of interest and grouping variable.
T_hss_table_multi
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.