This function returns character value previously stored in variable's label attribute. If none found, and fallback argument is set to TRUE (default), the function returns object's name (retrieved by deparse(substitute(x))), otherwise NA is returned with a warning notice.
label(x, fallback = TRUE, simplify = TRUE)a character vector with variable's label(s)
if (FALSE) { # \dontrun{
x <- rnorm(100)
label(x) # returns "x"
label(x, FALSE) # returns NA and issues a warning
label(mtcars$hp) <- "Horsepower"
label(mtcars) # returns "Horsepower" instead of "hp"
label(mtcars, FALSE) # returns NA where no labels are found
label(sleep, FALSE) # returns NA for each variable and issues a warning
} # }