Apply the formatting functions to each of the raw statistics. Function aliases are converted to functions using alias_as_fmt_fun().

apply_fmt_fun(x, replace = FALSE)

Arguments

x

(data.frame)
an ARD data frame of class 'card'

replace

(scalar logical)
logical indicating whether to replace values in the 'stat_fmt' column (if present). Default is FALSE.

Value

an ARD data frame of class 'card'

Examples

ard_summary(ADSL, variables = "AGE") |>
  apply_fmt_fun()
#> # An ARD data frame: 8 × 9
#>   variable context stat_name stat_label   stat stat_fmt fmt_fun warning error 
#>   <chr>    <chr>   <chr>     <chr>      <list> <list>    <list> <list>  <list>
#> 1 AGE      summary N         N          254    254            0 <NULL>  <NULL>
#> 2 AGE      summary mean      Mean        75.1  75.1           1 <NULL>  <NULL>
#> 3 AGE      summary sd        SD           8.25 8.2            1 <NULL>  <NULL>
#> 4 AGE      summary median    Median      77    77.0           1 <NULL>  <NULL>
#> 5 AGE      summary p25       Q1          70    70.0           1 <NULL>  <NULL>
#> 6 AGE      summary p75       Q3          81    81.0           1 <NULL>  <NULL>
#> 7 AGE      summary min       Min         51    51.0           1 <NULL>  <NULL>
#> 8 AGE      summary max       Max         89    89.0           1 <NULL>  <NULL>