mock | R Documentation |
Create empty ARDs used to create mock tables or table shells.
Where applicable, the formatting functions are set to return 'xx'
or 'xx.x'
.
mock_categorical(
variables,
statistic = everything() ~ c("n", "p", "N"),
by = NULL
)
mock_continuous(
variables,
statistic = everything() ~ c("N", "mean", "sd", "median", "p25", "p75", "min", "max"),
by = NULL
)
mock_dichotomous(
variables,
statistic = everything() ~ c("n", "p", "N"),
by = NULL
)
mock_missing(
variables,
statistic = everything() ~ c("N_obs", "N_miss", "N_nonmiss", "p_miss", "p_nonmiss"),
by = NULL
)
mock_attributes(label)
mock_total_n()
variables |
( a named list for functions |
statistic |
( |
by |
(named |
label |
(named |
an ARD data frame of class 'card'
mock_categorical(
variables =
list(
AGEGR1 = factor(c("<65", "65-80", ">80"), levels = c("<65", "65-80", ">80"))
),
by = list(TRTA = c("Placebo", "Xanomeline High Dose", "Xanomeline Low Dose"))
) |>
apply_fmt_fn()
mock_continuous(
variables = c("AGE", "BMIBL"),
by = list(TRTA = c("Placebo", "Xanomeline High Dose", "Xanomeline Low Dose"))
) |>
# update the mock to report 'xx.xx' for standard deviations
update_ard_fmt_fn(variables = c("AGE", "BMIBL"), stat_names = "sd", fmt_fn = \(x) "xx.xx") |>
apply_fmt_fn()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.