How to use read_sav() Function of haven Package In R Language
To read SPSS files in R we use the read_sav() function. To do so we firstly install the haven package using:
install.packages("haven")
Then, import haven package in R code and using read_sav() function read SPSS files.
Syntax:
read_sav(“FileName.sav”)
Example: Reading SPSS file
R
# import haven library package library ( "haven" ) # Use read_sav() function to read SPSS file dataframe <- read_sav ( "SPSS.sav" ) dataframe |
Output:
Read SPSS sav File into R
In this article, we are going to see how to read 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.
Contact Us