| prep_big_n | R Documentation |
bigN stat variablesprep_big_n():
recodes the "n" stat_name into bigN for the desired variables,
and
drops all other stat_names for the same variables.
If your tfrmt contains a big_n_structure() you pass the tfrmt column to
prep_big_n() via vars.
prep_big_n(df, vars)
df |
(data.frame) |
vars |
(character) a vector of variables to prepare |
a data.frame with the same columns as the input. The stat_name
column is modified.
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")
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.