Learn R Programming

sophisthse (version 0.7.0)

set_variable_labels: Set variable labels of a data.frame

Description

Set variable labels of a data.frame

Usage

set_variable_labels(df, labels)

Arguments

df
data.frame
labels
character vector of variable names

Value

data.frame with labelled variables

Details

Set variable labels of a data.frame. They will be nicely visible with `View()` in Rstudio.

Examples

Run this code
cars2 <- set_variable_labels(cars,
  labels = c("Speed (mph)", "Stopping distance (ft)"))

Run the code above in your browser using DataLab