describeFuns | R Documentation |
Concatenate one or more functions for output in tabler_stat
.
describeFuns(x, FUN, ...)
x |
a vector to be described by each |
FUN |
a list of functions that each return a named string; if
|
... |
ignored |
describeFuns(1:10, FUN = list(mean = mean, median = median))
describeFuns(1:10, FUN = list(Gmisc::describeMean, Gmisc::describeMedian))
describeFuns(1:10, FUN = list(function(...) Gmisc::describeMedian(..., iqr = FALSE)))
## typical usage
ff <- list(
'Median (full range)' = function(...) Gmisc::describeMedian(..., iqr = FALSE),
Gmisc::describeMean,
Min = min, Max = max
)
tabler_stat2(
mtcars, c('mpg', 'wt'), 'gear', FUN = NA,
statArgs = list(continuous_fn = function(x, ...) describeFuns(x, FUN = ff))
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.