Build data and AI skills | 50% off

Last chance! 50% off unlimited learning

Sale ends in


gtsummary (version 1.2.1)

assign_var_label: Assigns variable label to display.

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

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

Run this code
# NOT RUN {
gtsummary:::assign_var_label(mtcars, names(mtcars), list(hp = "Horsepower"))
# }

Run the code above in your browser using DataLab