render_cat: Render categorical values for table output.

View source: R/render_stat.R

render_catR Documentation

Render categorical values for table output.

Description

Called from cttab by default to render categorical (i.e. factor, character or logical) values for displaying in the table.

Usage

render_cat(x, ...)

Arguments

x

A vector of type factor, character or logical.

...

Further arguments, passed to cat_stat.

Details

This function was used by link{cttab} to render categorical variables. It essentially uses the values returned by cat_stat and put values to a vector. You can modified this to show any values you want, checkout the example below.

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

y <- factor(sample(0:1, 99, replace=TRUE), labels=c("Female", "Male"))
y[1:10] <- NA
render_cat(y)

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