Re: [Rd] importing explicitly declared missing values in read.spss (foreign)

From: Jeroen Ooms <>
Date: Mon, 04 Aug 2008 04:01:44 -0700 (PDT)

Prof Brian Ripley wrote:

>>From the messages you get I do not believe this is a recent version of read.spss (message 2 no longer appears)...

I am sorry you are right here, I was using an outdated version of foreign. I have updated my packages. My current version is now R version 2.7.1 (2008-06-23) with foreign_0.8-28.

I have experimented importing some spss datafiles, mostly from the sample data files that are included with SPSS. Most of these files do not generate any warnings, so I am not sure this is related to the missingness. However, the problem of read.spss() not returning any information on missingness persists in all of these datafiles.

Prof Brian Ripley wrote:
> All that is 'harmfull' is that you are not told that value labels NA and
> NAP were to be regarded as 'missing' in SPSS. We've no idea whether if
> would be a more or less egregious choice to map them to R's NA, and
> certainly are not in a position to assert 'far less harmfull' in general.

Of course the 'least harmfull' behavior of the function completely depends on the data and the user's intentions. I was explicitly suggesting making the mapping of missing values to <NA>'s optional, to give users who consider this appropriate, the option to replace these missings. I do not claim this to be the best default behavior, just a very useful feature.

View this message in context:
Sent from the R devel mailing list archive at

______________________________________________ mailing list
Received on Mon 04 Aug 2008 - 11:07:20 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 05 Aug 2008 - 12:35:53 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive