View source: R/ff_column_totals.R
ff_column_totals | R Documentation |
summary_factorlist()
outputAdd column totals to summary_factorlist()
output
ff_column_totals(
df.in,
.data,
dependent,
na_include_dependent = FALSE,
percent = TRUE,
digits = c(1, 0),
label = NULL,
prefix = "",
weights = NULL
)
finalfit_column_totals(
df.in,
.data,
dependent,
na_include_dependent = FALSE,
percent = TRUE,
digits = c(1, 0),
label = NULL,
prefix = "",
weights = NULL
)
df.in |
|
.data |
Data frame used to create |
dependent |
Character. Name of dependent variable. |
na_include_dependent |
Logical. When TRUE, missing data in the dependent variable is included in totals. |
percent |
Logical. Include percentage. |
digits |
Integer length 2. Number of digits for (1) percentage, (2) weighted count. |
label |
Character. Label for total row. |
prefix |
Character. Prefix for column totals, e.g "N=". |
weights |
Character vector of length 1: name of column to use for weights. |
Data frame.
explanatory = c("age.factor", "sex.factor", "obstruct.factor", "perfor.factor")
dependent = 'mort_5yr'
colon_s %>%
summary_factorlist(dependent, explanatory) %>%
ff_column_totals(colon_s, dependent)
# Ensure works with missing data in dependent
colon_s = colon_s %>%
dplyr::mutate(
mort_5yr = forcats::fct_na_value_to_level(mort_5yr, level = "(Missing)")
)
colon_s %>%
summary_factorlist(dependent, explanatory) %>%
ff_column_totals(colon_s, dependent)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.