tbl_wide_summary() is similar to tbl_summary(), but places the summary
statistics wide, in separate columns. All included variables must be of the
same summary type: all continuous summaries, or all categorical summaries
(which include dichotomous variables).
Usage
tbl_wide_summary(
data,
label = NULL,
statistic = switch(type[[1]], continuous = c("{median}", "{p25}, {p75}"), c("{n}",
"{p}%")),
digits = NULL,
type = NULL,
value = NULL,
sort = all_categorical(FALSE) ~ "alphanumeric",
include = everything()
)Arguments
- data
(
data.frame)
A data frame.- label
(formula-list)
Variable labels, e.g.list(age = "Age, years"). The default for each variable is itslabelattribute, or the column name when there is none.- statistic
(
character)
The statistics to present; each element of the vector becomes a column of the table. Default isc("{median}", "{p25}, {p75}")for continuous summaries andc("{n}", "{p}%")for categorical and dichotomous summaries.- digits
(formula-list)
How the statistics are rounded: integers or formatting functions. When not specified, the defaults come fromassign_summary_digits().- type
(formula-list)
The summary type,"continuous","categorical"or"dichotomous"; the default comes fromassign_summary_type().- value
(formula-list)
The level of a variable to show on a single row, e.g.value = list(response = 1). Default isNULL.- sort
(formula-list)
"alphanumeric"(the default) or"frequency"ordering of categorical levels.- include
(selector)
Variables to include. Default iseverything().