Produce table of counts and percentages for a list of variables in a dataset.
table_np(
data,
vars,
digits = 0,
comma = FALSE,
np_only = TRUE,
header = TRUE,
var_col = FALSE
)Input dataset.
Character vector of variables to get counts and percentages for.
Number of digits to use after the decimal point in percentages.
Option to use comma separator on thousands.
Option to return only the combined count and percentage variable.
Option to use variable names as headers.
Option to include variable name as a separate column.
Data frame with counts and percentages for a list of variables.
if (FALSE) { # \dontrun{
table_np(dat, c("var1", "var2"), digits = 1)
} # }