assign_var_label: Assigns variable label to display.

Description Usage Arguments Value Examples

Description

Preference is given to labels specified in fmt_table1(..., var_label = list()) argument, then to a label attribute attached to the data frame (i.e. attr(data$var, "label)), then to the variable name.

Usage

1
assign_var_label(data, variable, var_label)

Arguments

data

Data frame.

variable

Vector of column name.

var_label

list that includes specified variable labels, e.g. var_label = list(age = "Age, yrs")

Value

Vector variable labels.

Examples

1
gtsummary:::assign_var_label(mtcars, names(mtcars), list(hp = "Horsepower"))

ddsjoberg/clintable documentation built on June 9, 2019, 1:51 a.m.