Write DataFrame to SPSS .sav File in R
In this article, we are going to see how to write Dataframe to SPSS .sav File in R Programming language. The SPSS Statistics File Format is a proprietary binary format, developed and maintained as the native format for the SPSS statistical software application. To write a data frame in SPSS format in R we use the write_sav() function of the haven package in R.
- Data: Dataframe that is been exported
- Filename.sav: Filename where exported dataframe will be stored
Writing dataframe to SPSS .sav file
Here we are going to use the haven package, which is used to read write various data formats.
After running the code, we see a new file SPSSS.sav in your working directory.
We can see data in SPSS.sav file using the following code: