univ_perc: Percentages table for 0-1 variables

View source: R/tables_univariate.R

univ_percR Documentation

Percentages table for 0-1 variables

Description

Previously called univ_mr (for multiple responses) the function make descriptive statistics (n, percentages) for 0-1 variables

Usage

univ_perc(
  x,
  xname = NULL,
  sort_freq = TRUE,
  only_non_zero_perc = TRUE,
  latex = TRUE,
  latex_placement = "ht",
  label = NULL,
  caption = NULL,
  use_comments = TRUE,
  wb = NULL,
  sheets = NULL
)

Arguments

x

a (chunk of) data.frame encoding multiple responses (aka all composed of 0-1 variables)

sort_freq

sort by frequencies (descending)?

only_non_zero_perc

print only non zero percentages rows

latex

output the table using xtable::xtable

latex_placement

table placement for latex printing

label

latex label

caption

latex caption

use_comments

use comments for row (variable) names, if available

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)

Examples

set.seed(1)
data <- as.data.frame(matrix(rbinom(100, 1, p = 0.5), ncol = 10))
univ_perc(x = data)

lbraglia/lbstat documentation built on Sept. 17, 2023, 2:30 p.m.