Learn R Programming

summarytools (version 0.8.3)

label: Get Variable or Data Frame Label

Description

Returns character value previously stored in variable or data frame's label attribute, or NA if none found.

Usage

label(x, all = FALSE, fallback = FALSE, simplify = FALSE)

Arguments

x

An R object to extract labels from

all

Logical. When x is a data frame, setting this argument to TRUE will make the function return all variable labels. By default, its value is FALSE, so that if x is a data frame, it is the data frame's label that will be returned.

fallback

a logical value indicating if labels should fallback to object name(s). Defaults to FALSE.

simplify

When x is a data frame and all = TRUE, coerce results to a vector when TRUE, otherwise (default) return a named list containing only non-NULL/non-NA elements.

References

https://github.com/Rapporter/rapportools