Last active
December 26, 2015 03:49
-
-
Save mjrich/7088424 to your computer and use it in GitHub Desktop.
script for opening SPSS data (from Afrobarometer) in R
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(foreign) | |
library(memisc) | |
library(Hmisc) | |
setwd("C:\\your\\working\\folder") | |
#Open with standard foreign package | |
data_frame_attempt1 <- read.spss("yourdata.sav") | |
#Open with memisc package HT http://stackoverflow.com/questions/3136293/read-spss-file-into-r | |
data_frame_attempt2 <- data.frame(as.data.set(spss.system.file("yourdata.sav"))) | |
#Open with Hmisc package | |
data_frame_attempt3 = spss.get("yourdata.sav") | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment