From tlumley at u.washington.edu  Sat Nov  6 20:14:55 2004
From: tlumley at u.washington.edu (Thomas Lumley)
Date: Sat Nov  6 20:15:11 2004
Subject: [Rd] foreign(read.spss) in rw2000 and re2001beta
In-Reply-To: <x2zn1udfdc.fsf@biostat.ku.dk>
References: <418CE35B.1000502@acelerate.com> <x24qk3dkh5.fsf@biostat.ku.dk>
	<Pine.A41.4.61b.0411060900180.264288@homer07.u.washington.edu>
	<x2zn1udfdc.fsf@biostat.ku.dk>
Message-ID: <Pine.A41.4.61b.0411061107570.196336@homer08.u.washington.edu>

On Sat, 6 Nov 2004, Peter Dalgaard wrote:

> Thomas Lumley <tlumley@u.washington.edu> writes:
>
>> I have modified read.spss (but not committed the changes yet)  so that
>> it does not create a factor when there are missing levels.
>
> Hmm, could we handle this more elegantly? At the very least, we should
> probably try to keep the labels as an attribute, so that you have the
> option of doing something constructive with them afterwards.

They are kept as an attribute if use.value.labels=TRUE, whether or not a 
factor is created. I had thought they were always kept as an attribute 
even if use.value.labels=FALSE (as happens with read.dta), but this turns 
out not to be the case. This is easily fixed, and I will do so.


I have thought about a class that would make sense for data with some 
values labelled but not all. This is related to some other data 
representation issues that a colleague is asking about, and we may come up 
with a reasonably elegant and general solution.

 	-thomas


[Rd] foreign(read.spss) in rw2000 and re2001beta
Thomas Lumley