'I need to read file .sav into R
I am trying to read a .sav file into R.
First of all, I tried using the package haven
library(haven)
read_sav("dataset.sav")
But I got the following warning:
Erro: Failed to parse C:/dataset.SAV: Invalid file, or file has unsupported features.
Secondly, I used the package foreign.
library("foreign")
data2 <- read.spss("dataset.sav")
But I got the following warning:
Error in read.spss("dataset.sav") : file 'dataset.sav' is not in any supported SPSS format
Could someone tell me how can I fix it? Any help would be appreciated.
Thank you
Carvalho
Solution 1:[1]
I had the same problem until I checked type of my .sav file in checkfiletype.com and I found out that my .sav file is actually an ASCII txt file. check out this page: https://www.pippanorris.com/data and download "Data in SPSS" file which is a .sav file. if you can read this file without any problem, surely the problem comes from your original .sav file.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |
