Skip to content

levels(f)<-list doesn't work as expected when list is longer than nlevels(f) (PR#1394)

1 message · Hsiu-Khuern Tang

#
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:
Warning message: 
number of items to replace is not a multiple of replacement length
[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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._