[R] Hmisc variable labels as vector?

Peter Dalgaard P.Dalgaard at biostat.ku.dk
Mon Jul 16 11:48:20 CEST 2007


Steve Powell wrote:
> Dear members
> I have imported an SPSS data file using Hmisc. 
> So  label(mydata[[1]]) gives me the first variable label
> Just wondering how I can access all the variable labels as a vector?
> Something like label(mydata[[1:3]]) but that doesn't work.
>   
Something like sapply(mydata, label) should work.

-- 
   O__  ---- Peter Dalgaard             Øster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark          Ph:  (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)                  FAX: (+45) 35327907



More information about the R-help mailing list