htang@hpl.hp.com
2002-Mar-19 01:29 UTC
[Rd] levels(f)<-list doesn't work as expected when list is longer than nlevels(f) (PR#1394)
Full_Name: Hsiu-Khuern Tang Version: 1.4.1 OS: Linux Submission from: (NULL) (192.6.19.190) Hi all, When renaming the levels of a factor f using levels(f)<-list(...), if the list is longer than the original number of levels in f, the result is wrong. Example:> f <- factor(c("a","b"))> levels(f) <- list(C="C", A="a", B="b")Warning message: number of items to replace is not a multiple of replacement length> f[1] C A Levels: C A The answer should be something like [1] A B Levels: C A B Thanks, Hsiu-Khuern Tang. -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Possibly Parallel Threads
- plot.rpart ignores uniform=TRUE if graphics device is not open (PR#7361)
- cannot assign to NULL dimnames (PR#1042)
- typos in src/main/gram.y (PR#8780)
- Notes on building a gcc toolchain for Rtools (but not multilib)
- Notes on building a gcc toolchain for Rtools (but not multilib)