Created
March 1, 2016 18:32
-
-
Save igorbrigadir/0d03171e3e731b615f55 to your computer and use it in GitHub Desktop.
Convert SPSS SAV or DTA files to CSV with R
This file contains 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) | |
# SAV file? | |
write.table(read.spss("spss_data.sav", file="from_sav_data.csv", quote = FALSE, sep = ",") | |
# DTA file? | |
write.table(read.dta("spss_data.dta"), file="from_dta_data.csv", quote = FALSE, sep = ",") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Line 4 should be
write.table(read.spss("spss_data.sav"), file="from_sav_data.csv", quote = FALSE, sep = ",")
You missed a bracket.