Software
haven

haven

Read SPSS, Stata and SAS files from R

C

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

Resources using haven