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 status major 1 minor 8.0 year 2003 month 10 day 08 language R
Jake - The error message and warnign message shown below say something is wrong with this file's SPSS system-file header. If you are really able to open this one in SPSS, do so, change maybe a column name or row name or two, and save it again under a different file name. See if read.spss() chokes on the new version too. Caution - I'm just guessing, here, but it's something to try. - tom blackwell - u michigan medical school - ann arbor - On Tue, 4 Nov 2003, Jacob Wegelin wrote:> > 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 > status > major 1 > minor 8.0 > year 2003 > month 10 > day 08 > language R > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-help >
Jake - Very puzzling that a freshly-written copy of the file gives the same problem. As to your second question, my recollection is that read.spss() will be in package 'foreign'. The absolute reference is the source code itself, and this is often quite readable, whether it's commented or not. Ah . . . in order to see the source, you need to go back to CRAN sometimes and download a source version, even though you have no intention of re-compiling it yourself. That's highly recommended for questions of this sort. - tom blackwell - u michigan medical school - ann arbor - On Tue, 4 Nov 2003, Jacob Wegelin wrote:> > Tom, > > Thanks very much for your swift reply. I did change some of the column > names, eliminating all names with a pound sign in them, and got the same > problem. I guess I could change all the column and row names. > > It would be nice to know what exactly read.spss needs, though! > > Thanks again > > Jake > > On Tue, 4 Nov 2003, Thomas W Blackwell wrote: > > > Jake - > > > > The error message and warnign message shown below say something > > is wrong with this file's SPSS system-file header. If you are > > really able to open this one in SPSS, do so, change maybe a > > column name or row name or two, and save it again under a > > different file name. See if read.spss() chokes on the new > > version too. > > > > Caution - I'm just guessing, here, but it's something to try. > > > > - tom blackwell - u michigan medical school - ann arbor - > > > > On Tue, 4 Nov 2003, Jacob Wegelin wrote: > > > > > > > > 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 > > > status > > > major 1 > > > minor 8.0 > > > year 2003 > > > month 10 > > > day 08 > > > language R > > > > > > ______________________________________________ > > > R-help at stat.math.ethz.ch mailing list > > > https://www.stat.math.ethz.ch/mailman/listinfo/r-help > > > > > >
David Baird has created a free data conversion utility called dataload. See http://www.vsn-intl.com/genstat/downloads/dataload.htm 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 status 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
On Tue, 4 Nov 2003, Jacob Wegelin wrote:> > 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? >I don't think this is known. The read.spss code is taken from code in PSPP, which was going to be a GNU implementation of SPSS. Judging from some of the comments in the code, at least part of the format was worked out from files, not documented. I haven't run across any problems in using it to read SPSS .sav files, but most of the ones I have tried were created by the same people and don't represent independent confirmations. -thomas
Sorry, but there was an error in the link that I posted below. It should have been http://www.vsn-intl.com/genstat/downloads/datald.htm --- Date: Tue, 4 Nov 2003 19:54:06 -0500 From: Gabor Grothendieck <ggrothendieck at myway.com> To: <jawegelin at ucdavis.edu>, <R-help at stat.math.ethz.ch> Cc: <david.baird at agresearch.co.nz> Subject: RE: [R] read.spss Error reading system-file header David Baird has created a free data conversion utility called dataload. See http://www.vsn-intl.com/genstat/downloads/dataload.htm 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 status 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
Seemingly Similar Threads
- read.spss Error reading system-file header
- Is R good for not-professional-statistician, un-mathematical clinical researchers?
- Assistance with data import from Statistica
- lme unequal random-effects variances varIdent pdMat Pinheiro Bates nlme
- color in plot title: title(sub="something", col=4)