Use factor -- puhleeze read the Help file therefor: factor(x = character(), levels, labels = levels, exclude = NA, ordered = is.ordered(x))
either an optional vector of labels for the levels (in the same order as levels after removing those in exclude), or a character string of length 1. -- Bert 2011/8/11 Zeki Çatav <zca...@gmail.com>: > Prş, 2011-08-11 tarihinde 19:27 +0200 saatinde, Uwe Ligges yazdı: >> >> On 11.08.2011 19:22, David Winsemius wrote: >> > >> > On Aug 11, 2011, at 11:42 AM, Uwe Ligges wrote: >> > >> >> >> >> >> >> On 11.08.2011 16:10, zcatav wrote: >> >>> Hello R people, >> >>> >> >>> I have a "data.frame". Status variable has 3 values. 0->alive, >> >>> 1->dead and >> >>> 2->missed.......................... >> ......................................... >> As I understood the question, just how to rename the levels was the >> original question. >> >> Uwe > > I don't want to rename levels or converting from numeric to string. I > want to add each corresponding levels value, a label, as in SPSS. > Level 0 labeled with alive, > level 1 labeled with dead and > level 2 labeled with missed. > > > > -- > Zeki Çatav > > ______________________________________________ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > > -- "Men by nature long to get on to the ultimate truths, and will often be impatient with elementary studies or fight shy of them. If it were possible to reach the ultimate truths without the elementary studies usually prefixed to them, these would not be preparatory studies but superfluous diversions." -- Maimonides (1135-1204) Bert Gunter Genentech Nonclinical Biostatistics ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.