From the course: Learning the R Tidyverse

Unlock the full course today

Join today to access over 24,100 courses taught by industry experts.

Using haven to import from SPSS and other formats

Using haven to import from SPSS and other formats - R Tutorial

From the course: Learning the R Tidyverse

Using haven to import from SPSS and other formats

- [Instructor] Let's finish this chapter on reading data into the tidyverse by introducing the excellent Haven package. This package is going to be your friend if you are working with data that's in SPSS, SAS or Stata data files. The process is almost exactly the same for all file types, so we'll look at SPSS as it's a lot bit more common than the other two. Let's do that in project O3_04b. So inside of this project we have a script called SPSS data. At the top we're going to load the core tidyverse and the specialized tidyverse package, Haven. And we're going to work with a dataset I've pre downloaded from this DOI. So line six, we're going to use read_SPSS to read in our .sav data file and let's print this data file to the console. So I want to make this a little bit wider because I want to look at the marital column as well as other columns. So let me print that again and here, can you see how many of the columns here have a strange type? So the ID column is DBL for double, for…

Contents