Skip to content

Commit

Permalink
Use is.na() instead of vec_equal_na()
Browse files Browse the repository at this point in the history
  • Loading branch information
markfairbanks committed Oct 14, 2022
1 parent 93bf173 commit fabe36a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/step-setnames.R
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ step_setnames <- function(x, old, new, in_place, rename_groups = FALSE) {
# Replace position `NA` with column position
replace_setnames_na <- function(x) {
if (is.character(x)) {
vctrs::vec_assign(x, vctrs::vec_equal_na(x), "NA")
vctrs::vec_assign(x, is.na(x), "NA")
} else {
is_na <- vctrs::vec_equal_na(x)
is_na <- is.na(x)
na_locs <- seq_along(x)[is_na]
vctrs::vec_assign(x, is_na, na_locs)
}
Expand Down

0 comments on commit fabe36a

Please sign in to comment.