2021年4月11日星期日

Convert variable label for labeled numeric variable to a new charcter variable

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 seperate variable.

library(tidyverse)  library(webuse)  auto <- webuse("auto")  auto$foreign #Want to convert this to a character variable that reads "Domestic" or "Foreign"  
https://stackoverflow.com/questions/67051838/convert-variable-label-for-labeled-numeric-variable-to-a-new-charcter-variable April 12, 2021 at 10:07AM

没有评论:

发表评论