View source: R/replace_null_statistic.R
replace_null_statistic | R Documentation |
When a statistical summary function errors, the "stat"
column will be
NULL
. It is, however, sometimes useful to replace these values with a
non-NULL
value, e.g. NA
.
replace_null_statistic(x, value = NA, rows = TRUE)
x |
( |
value |
(usually a |
rows |
( |
an ARD data frame of class 'card'
# the quantile functions error because the input is character, while the median function returns NA
data.frame(x = rep_len(NA_character_, 10)) |>
ard_continuous(
variables = x,
statistic = ~ continuous_summary_fns(c("median", "p25", "p75"))
) |>
replace_null_statistic(rows = !is.null(error))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.