View source: R/tables_bivariate.R
biv_quali | R Documentation |
Bivariate table for categorical data.
biv_quali(
x = NULL,
y = NULL,
xname = NULL,
yname = NULL,
totals = TRUE,
tot_row_label = "Tot",
tot_col_label = "Tot",
useNA = "ifany",
perc = c("col", "row", "none"),
exclude_NA_perc = TRUE,
NA_string = "NA",
freq_sorting = c(NA, "desc", "asc"),
test = c("auto", "none", "fisher", "chisq", "mcnemar"),
test_params = list(),
latex = TRUE,
latex_placement = "ht",
label_prefix = "",
label = "",
caption_prefix = "",
caption = "",
wb = NULL,
sheets = ""
)
x |
row variable: a discrete quantitative variable, a character or a factor |
y |
column variable: a discrete quantitative variable, a character or a factor |
xname |
a string used to identify x variable (used for latex captions and excel sheets) |
yname |
a string used to identify x variable (used for latex captions and excel sheets) |
totals |
print totals? |
tot_row_label |
label for rows total |
tot_col_label |
label for columns total |
useNA |
print NA? |
perc |
type of percentages |
exclude_NA_perc |
remove NA from percentages (default = TRUE) |
NA_string |
character used for NA's columns title |
freq_sorting |
freq based sorting: can be |
test |
one of 'auto', 'none', 'fisher', 'chisq', 'mcnemar': if
|
test_params |
a list of parameters to be passed to the test performing function |
latex |
output the table using |
latex_placement |
table placement for latex printing |
label_prefix |
latex label prefix (useful for a common prefix in univariate_tables and multivariate_tables). It's ignored if label is specified (eg the latter is considered full/complete/correct) |
label |
latex label |
caption_prefix |
a prefix for latex caption (useful for a common prefix in univariate_tables and multivariate_tables) |
caption |
latex caption |
wb |
an openxlsx Workbook; if not NULL the table will be saved in the workbook too, aside printing |
sheets |
optional sheet names (same length as the number of tables) |
x <- airquality$Ozone < 80
y <- airquality$Month
biv_quali(x = x, y = y, latex = FALSE, test = 'none')
biv_quali(x = x, y = y, latex = FALSE, test = 'none', freq_sort = 'asc')
biv_quali(x = x, y = y, latex = FALSE, test = 'none', freq_sort = 'desc')
biv_quali(x = x, y = y, latex = FALSE, test = 'none', perc = FALSE )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.