View source: R/tables_univariate.R
univ_quali | R Documentation |
Univariate table for categorical data.
univ_quali(
x = NULL,
totals = TRUE,
useNA = "ifany",
NA_string = "NA",
freq_sorting = c(NA, "desc", "asc"),
latex = TRUE,
latex_placement = "ht",
label = NULL,
caption = NULL,
use_comments = TRUE,
wb = NULL,
sheets = NULL
)
x |
a discrete quantitative variable, a character or a factor |
totals |
print totals? |
useNA |
print NA? |
NA_string |
character used for NA's columns title |
freq_sorting |
freq based sorting: can be |
latex |
output the table using |
latex_placement |
table placement for latex printing |
label |
latex label |
caption |
latex caption |
use_comments |
use variable comments for caption if available (and none specified as comment=) |
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) |
wb = openxlsx::createWorkbook()
univ_quali(x = airquality$Month, wb = wb)
univ_quali(x = airquality[, c('Month')], wb = wb)
univ_quali(x = airquality[, c('Month', 'Day')], wb = wb)
univ_quali(x = airquality[, c('Month', 'Day')], latex = TRUE, wb = wb)
univ_quali(x = airquality[, c('Month', 'Day')], latex = TRUE,
label = c('tab:airq_month', 'tab:airq_day'),
caption = c('airquality month', 'airquality day'),
wb = wb)
univ_quali(list('a' = rep(LETTERS[1:5],2), 'b' = rep(letters[1:5],2)),
wb = wb)
lbmisc::wb_to_xl(wb = wb, file = '/tmp/univ_quali.xlsx')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.