Created
January 7, 2016 14:16
-
-
Save lindemann09/0c50a2925458140dcbae to your computer and use it in GitHub Desktop.
Convert SPSS data (.sav) to comma-separated text (.csv)
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
#!/usr/bin/Rscript | |
# | |
# Converts spss file to csv-file ("output.csv") | |
# | |
# usage: | |
# Rscript spss2csv.R <FILENAME> | |
library(foreign) | |
args <- commandArgs(trailingOnly = TRUE) | |
data = read.spss(args[1], to.data.frame=TRUE) | |
str(data) | |
write.csv(data, file="output.csv", row.names=F) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment