Skip to content

Commit

Permalink
Properly handle NA names
Browse files Browse the repository at this point in the history
  • Loading branch information
markfairbanks committed Oct 21, 2022
1 parent 227003d commit 2ae547d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions R/step-call-pivot_wider.R
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ pivot_wider.dtplyr_step <- function(data,
new_vars <- as.character(new_vars)
}

new_vars <- vctrs::vec_assign(new_vars, is.na(new_vars), "NA")

if (!is.null(names_glue)) {
glue_df <- as.data.table(distinct(ungroup(data), !!!syms(names_from)))
glue_df <- vctrs::vec_rep(glue_df, length(values_from))
Expand Down

0 comments on commit 2ae547d

Please sign in to comment.