[R] read.spss Error reading system-file header

Gabor Grothendieck ggrothendieck at myway.com
Wed Nov 5 01:54:06 CET 2003

David Baird has created a free data conversion utility 
called dataload.  See


It can translate SPSS files into other formats
including several that are readable by R (including csv
and rda).  I don't use SPSS myself but I have used 
dataload succesfully with Excel files.

(This is the same utility that was mentioned on the list
recently in connection with SAS.)

Date: Tue, 4 Nov 2003 15:58:02 -0800 (PST) 
From: Jacob Wegelin <jawegelin at ucdavis.edu>
To: <R-help at stat.math.ethz.ch> 
Subject: [R] read.spss Error reading system-file header 


Is there any documentation on what kind of SPSS file can and cannot be
read by read.spss? Alternatively, how can one modify or "clean" an SPSS
file to make it readable by read.spss? What properties must a *.sav file
before read.spss can read it?

The file in this example is 270KB, with 5 rows and 173 columns. I have no
trouble reading larger files with read.spss, so it's not merely a size
problem. I have no difficulty opening the file in SPSS. I also have no
trouble getting read.spss to read a dummy SPSS file with 5 rows and 173
columns, where each entry was randomly sampled from c(letters, LETTERS).

> library("foreign")
> junk<-read.spss("indata/z2EXvideo.sav")
Error in read.spss("indata/z2EXvideo.sav") :
Error reading system-file header.
In addition: Warning message:
indata/z2EXvideo.sav: File layout code has unexpected value 50331648. Value should be 2, in big-endian or little-endian format.

Thanks for any information

Jake Wegelin

> version
platform i386-pc-mingw32
arch i386
os mingw32
system i386, mingw32
major 1
minor 8.0
year 2003
month 10
day 08
language R

No banners. No pop-ups. No kidding.
Introducing My Way - http://www.myway.com

More information about the R-help mailing list