Questions tagged [haven]

7 questions
1
vote
0 answers

Keep SPSS Labels in R

I've imported survey data previously used in SPSS into R and I'm trying to work with them now. I need most variables to be numeric, but haven imports them as labelled variables. Whenever I convert them into numeric variables using the mutate /…
Sofia
  • 21
  • 3
1
vote
1 answer

rio and haven randomly interpret NAs in date column as 1582-10-14 when importing from SPSS

I am importing data from SPSS (sav file). In this data set there are several date columns, several of which contain cells with missing values. All date columns are imported as date variables into R, so far so good. All date entries from SPSS are…
Max
  • 91
  • 7
1
vote
2 answers

Modify encodings of accented characters in value labels

I am having a very hard time with accented characters in a stata file I have to import into R. I solved one problem over here, but there's another problem. After import, anytime I use the lookfor command in the labelled package I get this…
spindoctor
  • 1,719
  • 1
  • 18
  • 42
0
votes
0 answers

How to get DPLYR left_join to keep variable labels

I have a large dataset of household data where each year, each section of the survey is in a separate file, with keys allowing the files to be merged. I created a couple of functions with for loops to load and iteratively join all of these files. I…
Matt
  • 97
  • 10
0
votes
1 answer

Turn a Character Vector into Numeric Vector with labels

This seems extremely basic but I cannot find an efficient way to do this: I have character vector s<-c("LabelB","LabelX", "LabelE", "LabelE", "LabelX", "LabelD", "LabelB") What I want is a numeric vector where the numbers can be interpreted…
Zahra
  • 17
  • 4
0
votes
1 answer

unable to open .dat files on R even with haven installed

So I use SGA tools for processing my images. It gives back results in .dat files. Now in order to work on this data in R, I tried to import the .dat file using the haven package. I installed haven and then its library, but I am not able to import…
0
votes
1 answer

How to deal with Data Types in R

I'm working on analyzing the data from a survey. I have imported data from a SPSS file using haven. Now all the variables have the haven_labelled class. I'm very confused with the data types now. The survey is very long and in the end it should have…
Sofia
  • 21
  • 3