Displaying 1 result from an estimated 1 matches for "droplevels2i".
Did you mean:
droplevels2
2012 Nov 05
1
Another code to drop factor levels
I apologize if this is not appropriate for this mailing list.
In R, there is already functionality to drop unused factor levels. However, I am proposing the code below that I wrote. In some occasions, it was faster than applying function 'factor'. In any case, there is no restriction for anyone to use the code below.
droplevels2 <- function(x) {
if (is.null(levels(x)))
stop("no