Skip to contents

Used to assign the default formatting for variables summarized with tbl_summary().

Usage

assign_summary_digits(data, statistic, type, digits = NULL)

Arguments

data

(data.frame)
a data frame

statistic

(named list)
a named list; notably, not a formula-list-selector

type

(named list)
a named list; notably, not a formula-list-selector

digits

(named list)
a named list; notably, not a formula-list-selector. Default is NULL

Value

a named list

Examples

assign_summary_digits(
  mtcars,
  statistic = list(mpg = "{mean}"),
  type = list(mpg = "continuous")
)
#> $mpg
#> $mpg$mean
#> function (x) 
#> style_number(x, digits = digits, big.mark = big.mark, decimal.mark = decimal.mark, 
#>     scale = scale, prefix = prefix, suffix = suffix, ...)
#> <bytecode: 0x55cdaef13e90>
#> <environment: 0x55cdb794d1f0>
#> 
#> $mpg$N_obs
#> function (x) 
#> style_number(x, digits = digits, big.mark = big.mark, decimal.mark = decimal.mark, 
#>     scale = scale, prefix = prefix, suffix = suffix, ...)
#> <bytecode: 0x55cdaef13e90>
#> <environment: 0x55cdb79fd088>
#> 
#> $mpg$N_miss
#> function (x) 
#> style_number(x, digits = digits, big.mark = big.mark, decimal.mark = decimal.mark, 
#>     scale = scale, prefix = prefix, suffix = suffix, ...)
#> <bytecode: 0x55cdaef13e90>
#> <environment: 0x55cdb79fd088>
#> 
#> $mpg$N_nonmiss
#> function (x) 
#> style_number(x, digits = digits, big.mark = big.mark, decimal.mark = decimal.mark, 
#>     scale = scale, prefix = prefix, suffix = suffix, ...)
#> <bytecode: 0x55cdaef13e90>
#> <environment: 0x55cdb79fd088>
#> 
#> $mpg$p_miss
#> function (x) 
#> style_percent(x, prefix = prefix, suffix = suffix, digits = digits, 
#>     big.mark = big.mark, decimal.mark = decimal.mark, ...)
#> <bytecode: 0x55cdaef1fb48>
#> <environment: 0x55cdaf2b6460>
#> 
#> $mpg$p_nonmiss
#> function (x) 
#> style_percent(x, prefix = prefix, suffix = suffix, digits = digits, 
#>     big.mark = big.mark, decimal.mark = decimal.mark, ...)
#> <bytecode: 0x55cdaef1fb48>
#> <environment: 0x55cdaf2b6460>
#> 
#>