The haven package has the function
read_sav() for reading SPSS files. To load data from an SPSS file:
# Only need to install the first time install.packages("haven") library(haven) read_sav("datafile.sav")data <-
The haven package also includes functions to read from other formats:
An alternative to haven is the foreign package. It also supports SPSS and Stata files, but it is not as up-to-date as the functions from haven. For example, it only supports Stata files up to version 12, while haven supports up to version 14 (the current version as of this writing).
The foreign package does support some other formats, including:
read.octave(): Octave and MATLAB
read.xport(): SAS XPORT