Permalink
Browse files

mapvalues: use warn_missing for factors. Fixes #180

  • Loading branch information...
1 parent 9543c05 commit 10229e2fb9774aad4f503d5c530dd9766f230c8d @wch wch committed Nov 20, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 R/revalue.r
View
2 R/revalue.r
@@ -75,7 +75,7 @@ mapvalues <- function(x, from, to, warn_missing = TRUE) {
if (is.factor(x)) {
# If x is a factor, call self but operate on the levels
- levels(x) <- mapvalues(levels(x), from, to)
+ levels(x) <- mapvalues(levels(x), from, to, warn_missing)
return(x)
}

0 comments on commit 10229e2

Please sign in to comment.