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

Peter Dalgaard BSA p.dalgaard at biostat.ku.dk
Wed Jan 9 16:52:54 CET 2002


"Stuart Leask" <stuart.leask at nottingham.ac.uk> writes:

> Does anyone know how to access/list the value labels stored in a SPSS .sav
> file?
> At the moment I can read in variables using read.spss() (foreign package),
> but have to power up SPSS to check value labels.
> 
> Stuart

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.

Any takers?

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)             FAX: (+45) 35327907
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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