Skip to content

Commit

Permalink
Replace setdiff with consistent implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
chartgerink committed Feb 5, 2025
1 parent 75f050f commit b51a9d6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions R/restore_tags.R
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@ restore_tags <- function(x, tags,
stop("No matching tags provided.")
}

lost_vars <- setdiff(tags, names(x))

# We do not use setdiff because R has become inconsistent for our purposes
# Since https://github.com/wch/r-source/commit/6dedb304cfd66f0e5775cdd5c0bae6340ac48e84 # nolint: line_length_linter.
lost_vars <- tags[!unlist(tags) %in% names(x)]
if (lost_action != "none" && length(lost_vars) > 0) {
lost_tags <- names(lost_vars)

Expand Down

0 comments on commit b51a9d6

Please sign in to comment.