Skip to content

Commit

Permalink
Merge pull request #181 from atorus-research/159_bug_type_factor_levels
Browse files Browse the repository at this point in the history
Make `xportr_type()` drop factor levels
  • Loading branch information
EeethB authored Nov 28, 2023
2 parents dc751f3 + cd65f02 commit 582aa27
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions R/type.R
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 582aa27

Please sign in to comment.