Skip to content

Instantly share code, notes, and snippets.

@DrDanL
Forked from igorbrigadir/convert.R
Last active February 11, 2018 18:12
Show Gist options
  • Save DrDanL/2babb7b2e79d9621fcf64df02b997423 to your computer and use it in GitHub Desktop.
Save DrDanL/2babb7b2e79d9621fcf64df02b997423 to your computer and use it in GitHub Desktop.
Convert SPSS SAV or DTA data files to CSV with R
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