diff --git a/NEWS.md b/NEWS.md index c066e5e7..4b0d5d71 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,7 @@ +# xportr 0.3.1 + +* Make `xportr_type()` drop factor levels when coercing variables + # xportr 0.3.0 ## New Features and Bug Fixes diff --git a/R/type.R b/R/type.R index 0114309c..78cf6dca 100644 --- a/R/type.R +++ b/R/type.R @@ -168,6 +168,7 @@ xportr_type <- function(.df, if (!is_correct[i]) { orig_attributes <- attributes(.df[[i]]) orig_attributes$class <- NULL + orig_attributes$levels <- NULL if (correct_type[i] %in% characterTypes) { .df[[i]] <<- as.character(.df[[i]]) } else {