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/gtsummary-v0.1 documentation built on June 4, 2019, 7:48 a.m.