Re: [R] read.spss (package foreign) and SPSS 15.0 files

From: John Kane <jrkrideau_at_yahoo.ca>
Date: Fri 06 Apr 2007 - 00:45:00 GMT

> Hello,
>
> does anyone have experience with reading SPSS
> Version 15.0 files into R (version 2.4.1, WinXP)?
>
> I have long been sucessfully reading SPSS files with
> read.spss from the wonderful foreign package, but
> somehow after upgrading from SPSS14 to SPSS15 I seem
> to have problems.
>
> Trying a simple example, where test.sav is a SPSS
> 15.0 data file consisting of x1=c(1,2,3) and
> x2=c("a","b","c"), I get this:
> > read.spss(file = "C:\\temp\\test.sav")
> Fehler in read.spss(file = "C:\\temp\\test.sav") :
> error reading system-file header
> Zusätzlich: Warning message:
> C:\temp\test.sav: File-indicated character
> representation code (Unknown) is not ASCII
>
> version infos:
> R version 2.4.1 (under WinXP)
> foreign version 0.8-18
>
> Has anyone experienced the same, and can give a
> solution here (possibly other than "downgrade to
> SPSS14.0" ;-))?
>
> Regards,
> Heinrich.

 Heck. I'd be happy to get an answer to what is happening here:
> mac <- spss.get("H:/ONTH/Raw.data/Follow.sav")
Warning message:
H:/ONTH/Raw.data/Follow.sav: Unrecognized record type 7, subtype 16 encountered in system file

I have taken to exporting the file to a delimited format and reading it into R since I cannot trust the R import.



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Fri Apr 06 10:47:30 2007

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Wed 11 Apr 2007 - 07:31:04 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.