getlabel: Obtain label of variable(s) based on metadata information

View source: R/getlabel.R

getlabelR Documentation

Obtain label of variable(s) based on metadata information

Description

A function to obtain label of one vector or each variable in one data frame based on pre-defined metadata information.

Usage

getlabel(x, meta = NULL, unit = TRUE, fit = FALSE)

Arguments

x

a vector or data frame to get label.

meta

a data frame contains metadata of the dataset. This data frame should have the following variables: varname (character variable specifies name of each variable), label (character variable specifies label of each variables), type (character variable specifies type of each variable [numeric, factor, character, datetime], unit (character variable specifies units of each continuous variable), scale (numeric variable specifies how each variable will be scaled).

unit

a logical value specifies whether unit will be appended in the label of continuous variables.

fit

a logical value specifies whether the label will use presentation as in model fitting.

Value

vector of character of label


oucru-biostats/C306 documentation built on July 16, 2024, 2:33 p.m.