generate_xtab_3way: Generate three-way crosstabs

View source: R/generate_xtab.R

generate_xtab_3wayR Documentation

Generate three-way crosstabs

Description

[Experimental]

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").

Usage

generate_xtab_3way(df, x, y, z, weight, caption)

Arguments

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.

Value

A list object, which is an object of class flextable.

See Also

generate_xtab_word() for two-way crosstabs.

Examples


# Generate a crosstab
df %>% generate_xtab_3way(df = ., "x_var", "y_var", "z_var", "weight", "Z by X And Y")


YangWu1227/citizenr documentation built on June 18, 2022, 12:17 p.m.