View source: R/add_calculated_row.R
| add_calculated_row | R Documentation | 
Use this function to add a new statistic row that is a function of the other statistics in an ARD.
add_calculated_row(
  x,
  expr,
  stat_name,
  by = c(all_ard_groups(), all_ard_variables(), any_of("context")),
  stat_label = stat_name,
  fmt_fn = NULL
)
| x | ( | 
| expr | ( | 
| stat_name | ( | 
| by | ( | 
| stat_label | ( | 
| fmt_fn | ( | 
an ARD data frame of class 'card'
ard_continuous(mtcars, variables = mpg) |>
  add_calculated_row(expr = max - min, stat_name = "range")
ard_continuous(mtcars, variables = mpg) |>
  add_calculated_row(
    expr =
      dplyr::case_when(
        mean > median ~ "Right Skew",
        mean < median ~ "Left Skew",
        .default = "Symmetric"
      ),
    stat_name = "skew"
  )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.