Statistical Software Packages

R packages for import data

Package Goal Imports from
{haven}
Consistent, easy, fast
SAS, STATA, SPSS
{foreign}
Many data formats

Import file

Package SAS STATA SPSS
{haven}
read_sas(filename)
read_dta(filename), read_stata(filename)
read_sav(fn), read_por(fn)
{foreign}
read_dta(filename,convert.factors=FALSE, convert.underscore=TRUE)
read.spss(filename, to.data.frame=TRUE)
# Convert values in Date column to dates
sugar$Date<-as.Date(as_factor(sugar$Date))

# Import traits file
traits<-read_sav("person.sav") 
# Print out a subset 
subset(traits,Extroversion>40 & Agreeableness>40)
traits$GENDER<- as_factor(traits$GENDER)