Re: Fwd: R-beta: Printing

Hubert Palme (palme@uni-wuppertal.de)
Mon, 16 Mar 1998 16:53:24 +0100 (MET)


Date: Mon, 16 Mar 1998 16:53:24 +0100 (MET)
Message-Id: <199803161553.QAA07487@wrin27.urz.uni-wuppertal.de>
From: palme@uni-wuppertal.de (Hubert Palme)
To: Thomas Lumley <thomas@biostat.washington.edu>
Subject: Re: Fwd: R-beta: Printing
In-Reply-To: <Pine.SUN.3.95.980313085535.16696C-100000@chekov>
	<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: palme@uni-wuppertal.de             (Germany)
http://www.hrz.uni-wuppertal.de/hrz/personen/h_palme.html
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._