render.categorical.default: Render categorical values for table output.

Description Usage Arguments Value Examples

View source: R/tab1.R

Description

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

Usage

1
render.categorical.default(x, ..., na.is.category = FALSE)

Arguments

x

A vector of type factor, character or logical.

...

Further arguments, passed to stats.apply.rounding.

na.is.category

Include missing values in the denominator for calculating percentages or omit them (the default). This option do not for the moment.

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. However, the first names should be empty as it will be replaced by the name of the variable. Empty strings are allowed and result in empty table cells.

Examples

1
2
3
y <- factor(sample(0:1, 99, replace=TRUE), labels=c("Female", "Male"))
y[1:10] <- NA
render.categorical.default(y)

adayim/cttab documentation built on Dec. 18, 2021, 10:27 p.m.