How to use Hmisc Package In R Language

Hmisc package have spps.get() methods to read the sav file in R Programming Language.

To install the package:

install.packages('Hmisc')

Syntax: 

spps.get(“File”, to.data.frame = TRUE/FALSE)

Example: Reading SPSS file

R




library("Hmisc")
  
data2 <- spss.get("airline_passengers.sav",
                  to.data.frame = TRUE)
head(data2)


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

Similar Reads

Method 1: Using haven Package

Here we will use the haven package to import the SAS files....

Method 2: Using foreign Package

...

Method 3: Using Hmisc Package

Foreign package has read.spss() methods to read the sav file in R Programming Language....

Contact Us