

haven
Read SPSS, Stata and SAS files from R
haven is an R package that reads and writes data files from SAS, SPSS, and Stata statistical software. It wraps the ReadStat C library to handle these proprietary formats and returns data as tibbles.
The package preserves important metadata like value labels through a labelled() class, handles special missing values correctly, and converts dates and times to R’s native classes. It supports modern file format versions (SAS .sas7bdat and transport files, SPSS .sav and .por files, and Stata .dta files up to version 15) and provides both read and write functions for most formats.
Contributors

Hadley Wickham
Chief Scientific Officer

Lionel Henry
Senior Software Engineer

Jeroen Ooms
Software Engineer

Jeroen Janssens
Head of Developer Relations

JJ Allaire
Founder and Executive Chairman
Resources using haven

Importing data with the tidyverse
cheatsheetLearn about readr, readxl, and haven.
