When importing a dataset from Stata to R, it often comes with helpful labels for numeric variables. I would like to be able to convert the data in the labels to a new separate variable. The equivalent command in Stata is decode.
library(tidyverse)
library(webuse)
auto <- webuse("auto")
auto$foreign #Want to convert this to a character variable that reads "Domestic" or "Foreign"