[R] read.spss: variable.labels

Frank E Harrell Jr f.harrell at vanderbilt.edu
Tue Oct 7 21:13:58 CEST 2008


soeren.vogel at eawag.ch wrote:
> Hi,
> 
> how can I attach variable labels originally read by read.spss() to the 
> resulting variables?
> 
> <pre>
> X <- read.spss('data.sav', use.value.labels = TRUE, to.data.frame = 
> TRUE, trim.factor.names = TRUE, trim_values = TRUE, reencode = "UTF-8")
> names(X) <- tolower(names(X))
> attach(X)
> </pre>
> 
> Thank you
> 
> Sören

library(Hmisc)
?spss.get


-- 
Frank E Harrell Jr   Professor and Chair           School of Medicine
                      Department of Biostatistics   Vanderbilt University



More information about the R-help mailing list