From tlumley@u.washington.edu  Tue Feb 13 00:44:58 2001
From: tlumley@u.washington.edu (Thomas Lumley)
Date: Mon, 12 Feb 2001 16:44:58 -0800 (PST)
Subject: [Rd] Sticky levels (PR#846)
In-Reply-To: <200102130038.BAA29298@pubhealth.ku.dk>
Message-ID: <Pine.A41.4.21.0102121642400.133498-100000@homer27.u.washington.edu>

On Tue, 13 Feb 2001 bwheeler@echip.com wrote:

> This isn't actually a bug, 

True. Perhaps R-bugs wasn't the best place for it initially?

>			but what is one to do
> in cast of a typo?
> 
> > citizen<-factor(c("uk","as","no","au","uk","us","us"))
> > levels(citizen)
> [1] "as" "au" "no" "uk" "us"
> > citizen[2]<-"us"

  citizen<-as.character(citizen)
  citizen[2]<-"us"
  citizen<-factor(citizen)

would do it. Yes, certain aspects of factors are a pain at times.


	-thomas

Thomas Lumley			Asst. Professor, Biostatistics
tlumley@u.washington.edu	University of Washington, Seattle

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel 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-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


[Rd] Sticky levels (PR#846)
Thomas Lumley