[R] Importing data with value labels into R
Maryam Iraniparast
m|r@n|p@r@@t @end|ng |rom uw@ter|oo@c@
Mon Nov 14 19:07:29 CET 2022
Hello!
I want to read SPSS data into R and I want to carry the value labels with my dataset.
Based on my research, only Stata file can transfer the value labels to R (It is easy to save SPSS data with Stata format).
The last time I did that successfully, I was using R4.2.1 and the following code. But it does not work anymore.
install.packages("tidyverse")
install.packages("haven")
library(tidyverse)
library(haven)
df=file.choose() *Note: Select the STATA file from the folder where it is saved.
dataset=read.dta(df)
I appreciate any thoughts or suggestion.
Thanks,
Mary
[[alternative HTML version deleted]]
More information about the R-help
mailing list