Re: [Rd] foreign(read.spss) in rw2000 and re2001beta

From: Thomas Lumley <tlumley_at_u.washington.edu>
Date: Sun 07 Nov 2004 - 04:04:45 EST

On Sat, 6 Nov 2004, Peter Dalgaard wrote:

> Kjetil Brinchmann Halvorsen <kjetil@acelerate.com> writes:
>
>> I made a test file test.sav with SPSS version 11.5.1
>> containing only one numeric variable, with a value label
>> for one value not occuring in the file. According to ?read.spss
>> this should result in a factor, but it results in all NA.
>

It should result in a factor all of whose values are missing. And it does.

I have modified read.spss (but not committed the changes yet) so that it does not create a factor when there are missing levels.

The problem is that SPSS uses value labels for two different things: for factors and for labelling a subset of values (eg different types of missing). It is hard for R to guess which the user intends.

You can always set use.value.labels=FALSE. You still get the value labels read in and then you can decide what to do with them.

         -thomas



R-devel@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Sun Nov 07 04:19:06 2004

This archive was generated by hypermail 2.1.8 : Fri 18 Mar 2005 - 09:01:08 EST