This isn't actually a bug, 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[1] uk us no au uk us us Levels: as au no uk us ** [STICKY "as"] **> citizen[2]<-"gs"Warning message: invalid factor level, NAs generated in: [<-.factor(*tmp*, 2, value = "gs") -- Bob Wheeler --- (Reply to: bwheeler@echip.com) ECHIP, Inc. -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._