Search code examples
rcsvdatatablespsscrosstab

Convert SPSS file to CSV and read to create Data Table


I have an SPSS file from which I am creating a data table using R script. But the problem is it's taking a bit of time to load the data table. I want to convert the SPSS(.sav) file into CSV file first and then read the CSV file to create a data table. So far I have tried multiple codes but that didn't work out properly. Here's the code which I got from this.


Solution

  • I think foreign package in r can be used to solve this problem.

    library(foreign)
    write.table(read.spss("inFile.sav"), file="outFile.csv", quote = TRUE, sep = ",")