render_numeric: Render continuous values for table output.

View source: R/render_stat.R

render_numericR Documentation

Render continuous values for table output.

Description

Called from cttab by default to render continuous (i.e. numeric) values for displaying in the table.

Usage

render_numeric(x, what = "Median [Min, Max]", ...)

Arguments

x

A numeric vector.

what

A character or vector what will be reported for numeric variables, default is median and min, max. See num_stat for the statistics this function support. The provided name will be used as statistic names, and the values will be converted to upper to report corresponding statistic. If you want to have a fancy name, use a named vector with names as the statistics will be printed and values are the statistics. For example, c("Geo. Mean (Geo. CV%)" = "GMean (GCV)", "Median [IQR]" = "Median [IQR]"). Separate statistics with comma or a space or any non-letters.

...

Further arguments, passed to num_stat.

Details

This function was used by link{cttab} to render numeric variables. It essentially uses the values returned by num_stat and put values to a vector.

Value

A character vector. Each element is to be displayed in a separate cell in the table. The names of the vector are the labels to use in the table.

See Also

signif_pad round_pad num_stat

Examples

x <- exp(rnorm(100, 1, 1))
render_numeric(x)


shug0131/cctu documentation built on Nov. 10, 2023, 12:03 p.m.