Skip to content

some SPSS 15 files wont open in R 2.4.0

2 messages · Sam Smith, Brian Ripley

#
Trying to open some SPSS .sav files (saved with SPSS 15) gives the following:

 	read.spss('/data/big/unzipped_ukda/seh3767/3767SPSS_570D6A086C9A1B0636F13255F25A58C1/prgrp95.sav')
 	Error in 
read.spss("/data/big/unzipped_ukda/seh3767/3767SPSS_570D6A086C9A1B0636F13255F25A58C1/prgrp95.sav"): 
error reading system-file header
 	In addition: Warning message:
 	/data/big/unzipped_ukda/seh3767/3767SPSS_570D6A086C9A1B0636F13255F25A58C1/prgrp95.sav:
 	File-indicated character representation code (Unknown) is not ASCII

Some are fine in R, some are not.


The file opens in SPSS, and googling the error message gives
this mail about PSPP
         http://www.nabble.com/problem-loading-SPSS-15.0-save-files-t2726500.html
which includes a diff for the PSPP code which opens R files
and throws that exact error message back.

R documentation says that it uses some code based on PSPP,
I can't see it in the R distribution?. Does anyone with more
clue than I know whether the above is likely to fix it, and
where I should be looking for the code to change?


Alternatively, has anyone got any ideas on opening these files?





Thanks

Sam
#
On Thu, 5 Apr 2007, Sam Smith wrote:

            
This is not 'in R', it is in contributed (recommended) package 'foreign', 
so it is that's version that is relevant here. (We do ask for 
sessionInfo() in the R posting guide for good reason.)
'R files'?  Surely, 'SPSS 15 files'!

That just removes a test.  If Ben Pfaff thinks it is no longer needed, I 
suppose we could just remove it, but what happens if SPSS has Latin-1 or 
UTF-8 data?  I think we should give a warning if not an error.
Look in the tarball for foreign (in src/library/Recommended).
Use SPSS and re-save in an open format?