search for: maplevels

Displaying 2 results from an estimated 2 matches for "maplevels".

Did you mean: amplevel
2006 Nov 11
0
c() for factors
Dear R-core! I have written a function mapLevels() to map levels of a factor. It can produce a map (internally a list) of factor levels and internal integer codes. I call this integer levelsMap. There is also character levelsMap, but not of importance at this moment. I found out that it was quite straightforward to write c() method for factors wi...
2017 Jul 06
3
Efficient swapping
Thanks a lot, Ista! I really appreciate it. How about a slightly different case as the following: set.seed(1) (tmp <- data.frame(x = 1:10, R1 = sample(LETTERS[1:5], 10, replace = TRUE), R2 = sample(LETTERS[2:6], 10, replace = TRUE))) x R1 R2 1 C B 2 B B 3 C E 4 E C 5 E B 6 D E 7 E E 8 D F 9 C D 10 A E Notice that the factor levels between