View source: R/generate_xtab.R
generate_xtab_3way | R Documentation |
This function takes a data frame or a tibble object, a few variables, and a string caption, returning
a list object that is an instance of class flextable
. The function implements data masking internally
so users must specify data variables as strings (i.e. use "x", "y", "z", "weight").
generate_xtab_3way(df, x, y, z, weight, caption)
df |
A data frame or tibble. |
x |
A single string of the independent variable. |
y |
A single string of the dependent variable. |
z |
A single string of the control variable. |
weight |
A single string of the weighting variable. |
caption |
A length one character vector used as the caption for the crosstab. |
A list object, which is an object of class flextable
.
generate_xtab_word()
for two-way crosstabs.
# Generate a crosstab df %>% generate_xtab_3way(df = ., "x_var", "y_var", "z_var", "weight", "Z by X And Y")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.