Learn R Programming

table1 (version 1.4.3)

render.varlabel: Render variable labels for table output.

Description

Called from table1.formula by default to render variable labels for displaying in the table.

Usage

render.varlabel(x, transpose = F)

Value

A character, which may contain HTML markup.

Arguments

x

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

transpose

Logical indicating whether on not the table is transposed.

Examples

Run this code
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)

Run the code above in your browser using DataLab