How to use foreign Package In R Language
Foreign package has read.spss() methods to read the sav file in R Programming Language.
To install the package:
install.packages('foreign')
Syntax:
read.spps(“File”, to.data.frame = TRUE/FALSE)
Example: Reading SPSS file
R
library ( "foreign" ) data1 <- read.spss ( "airline_passengers.sav" , to.data.frame = TRUE ) head (data1) |
Output:
number 112 118 132 129 121 135
How to Import SPSS Files into R?
In this article, we are going to see how to import SPSS Files(.sav files) into R Programming Language.
Used file: Click