prep_big_n():
recodes the
"n"stat_nameintobigNfor the desired variables, anddrops all other
stat_namesfor the same variables.
If your tfrmt contains a big_n_structure() you pass the tfrmt column to
prep_big_n() via vars.
Examples
df <- data.frame(
stat_name = c("n", "max", "min", rep(c("n", "N", "p"), times = 2)),
context = rep(c("continuous", "hierarchical", "categorical"), each = 3),
stat_variable = rep(c("a", "b", "c"), each = 3)
) |>
dplyr::bind_rows(
data.frame(
stat_name = "n",
context = "total_n",
stat_variable = "d"
)
)
prep_big_n(
df,
vars = c("b", "c")
)
#> stat_name context stat_variable
#> 1 n continuous a
#> 2 max continuous a
#> 3 min continuous a
#> 4 bigN hierarchical b
#> 5 bigN categorical c
#> 6 bigN total_n d