render.varlabel: Render variable labels for default table1 output.

View source: R/table1.R

render.varlabelR Documentation

Render variable labels for default table1 output.

Description

Called from table1.formula by default to render variable labels for displaying in the table. This is the default function, but it can be overriden by a user-supplied function.

Usage

render.varlabel(x, ..., transpose = F)

Arguments

x

A vector, usually with the label and (if appropriate) unit attributes.

...

Additional arguments.

transpose

Logical indicating whether on not the table is transposed.

Value

A character, which may contain HTML markup.

Examples

x <- exp(rnorm(100, 1, 1))
label(x) <- "Weight"
units(x) <- "kg"
render.varlabel(x)

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

benjaminrich/table1 documentation built on June 10, 2025, 10:43 p.m.