Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reading .sav file into R

Tags:

r

spss

I am trying to read a .sav file into R but I got the following warning:

library("memisc") dataset <- data.frame(as.data.set(spss.system.file("dataset.sav"))) 

parseSysHeader(ptr) : file lacks info_flt64 record, using defaults

Could someone tell me what this warning means and how to fix it? Any help would be appreciated.

Thank you

Takahiro

like image 361
Takahiro Avatar asked Oct 08 '15 21:10

Takahiro


People also ask

How do I read a .SAV File?

To open the SAV file using ClientSettings Editor, simply select File → Open, navigate to your SAV file, and click Open. When you are finished modifying the file, select File → Save or Save As, name the file, choose the save location, and click Save.

Can you read SPSS File in R?

R can import datasets from SPSS with the function read.


1 Answers

You can also use the 'haven' package to read in the SPSS file. This package has much more consistency over the foreign package, with regard to syntax. Also, the resulting data frame will have both the 'tbl_df' and 'tbl' classes so printing will be improved if dplyr is loaded.

library(haven)  path = file.path("C:/", "Folder", "dataset.sav") dataset = read_sav(path) 
like image 187
Richard Lusch Avatar answered Sep 17 '22 14:09

Richard Lusch