[R] SPSS variable lables import

Thomas Lumley tlumley at u.washington.edu
Tue Jun 6 16:14:01 CEST 2006


On Tue, 6 Jun 2006, Frank Thomas wrote:

> Hi,
> I try to get the variable labels of a SPSS data file into R but don't
> find this mentioned in the help file for foreign. Is there another way
> to get them ?
> BTW: An SPSS variable name is like: VAR001, whereas the variable label
> might be 'Identification no.'

mydata <- read.spss("mydata.sav")
attr(mydata, "variable.labels")

 	-thomas

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



More information about the R-help mailing list