Permalink
Browse files

Fix another problem with missing levels

  • Loading branch information...
1 parent 2a8574d commit 84bf8c92dbad905a32dc87a35b1afb7c1c4a7e1e @hadley committed Nov 27, 2013
Showing with 1 addition and 0 deletions.
  1. +1 −0 R/splitter-d.r
View
@@ -85,6 +85,7 @@ split_labels <- function(splits, drop, id = plyr::id(splits, drop = TRUE)) {
ulevels <- function(x) {
if (is.factor(x)) {
+ x <- addNA(x, ifany = TRUE)
levs <- levels(x)
factor(levs, levels = levs)
} else {

0 comments on commit 84bf8c9

Please sign in to comment.