Re: Fwd: R-beta: Printing

Hubert Palme (
Mon, 16 Mar 1998 16:53:24 +0100 (MET)

Date: Mon, 16 Mar 1998 16:53:24 +0100 (MET)
Message-Id: <>
From: (Hubert Palme)
To: Thomas Lumley <>
Subject: Re: Fwd: R-beta: Printing
In-Reply-To: <Pine.SUN.3.95.980313085535.16696C-100000@chekov>

Thomas Lumley: 
 > >Another question: Is there any simple way to assign value labels?
 >  Some of the functions of variable labels in eg SPSS are performed by
 > factor levels, so if you use
 > 	x<-factor(x,labels=c("first level","second level","third level"))
 > the factor labels will usually appear in output. read.table() converts
 > non-numeric data to factors by default, which means that the data file can
 > contain labels instead of the data.

OK. I had to add 'levels=1:n' (number of values), otherwise R complains
about labels for values not present in tha data. Now it works fine.

Next stupid question:-)

Is there a similar way to assign variable labels (besides the names,
of course)?

Thanks a lot for your help!

Hubert Palme         Bergische Universitaet-Gesamthochschule Wuppertal
                                      Computing  Center
                                      D-42097 Wuppertal
Email:             (Germany)
r-help mailing list -- Read
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: