[R] value labels from read.spss()?

Thomas Lumley tlumley at u.washington.edu
Wed Jan 9 17:19:39 CET 2002


On 9 Jan 2002, Peter Dalgaard BSA wrote:

>
> I don't think this is currently implemented but it might not be too
> difficult to do. As far as I can see the code in foreign already knows
> how to read the stuff, it just never gets copied into R variables.
>
> The internal format is somewhat different from R's idea of a factor,
> but it should be workable:
>
> Essentially there's a list of label records, which each have a list of
> <value, label> pairs, and an associated list of variables (in index
> form) to which the format applies.
>

There's also an example to work from in read.dta, which does turn value
labels into factor levels. As with SPSS the information wasn't stored in
an ideal format, but I just returned it all as attributes on the data
object and did the necessary reordering and conversion in interpreted
code.


	-thomas

Thomas Lumley			Asst. Professor, Biostatistics
tlumley at u.washington.edu	University of Washington, Seattle

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list