[Rd] Sticky levels (PR#846)

Thomas Lumley tlumley@u.washington.edu
Mon, 12 Feb 2001 16:44:58 -0800 (PST)


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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._