Skip to content

Commit

Permalink
bring collapse back
Browse files Browse the repository at this point in the history
  • Loading branch information
etiennebacher committed Feb 12, 2024
1 parent 518edd3 commit 525310f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.1
SystemRequirements: Cargo (>= 1.56) (Rust's package manager), rustc
Imports:
collapse,
dplyr,
tibble,
tidyr
Expand Down
12 changes: 6 additions & 6 deletions R/jaccard_join_core.R
Original file line number Diff line number Diff line change
Expand Up @@ -155,21 +155,21 @@ jaccard_join <- function (a, b, mode, by, salt_by, n_gram_width, n_bands,
switch(
mode,
"left" = {
not_matched_a <- ! seq(nrow(a)) %in% match_table[,1]
not_matched_a <- collapse::`%!iin%`(seq(nrow(a)), match_table[, 1])
matches <- dplyr::bind_rows(matches, a[not_matched_a,])
},
"right" = {
not_matched_b <- ! seq(nrow(b)) %in% match_table[,2]
not_matched_b <- collapse::`%!iin%`(seq(nrow(b)), match_table[, 2])
matches <- dplyr::bind_rows(matches, b[not_matched_b,])
},
"full" = {
not_matched_a <- ! seq(nrow(a)) %in% match_table[,1]
not_matched_b <- ! seq(nrow(b)) %in% match_table[,2]
not_matched_a <- collapse::`%!iin%`(seq(nrow(a)), match_table[, 1])
not_matched_b <- collapse::`%!iin%`(seq(nrow(b)), match_table[, 2])
matches <- dplyr::bind_rows(matches, a[not_matched_a,], b[not_matched_b,])
},
"anti" = {
not_matched_a <- ! seq(nrow(a)) %in% match_table[,1]
not_matched_b <- ! seq(nrow(b)) %in% match_table[,2]
not_matched_a <- collapse::`%!iin%`(seq(nrow(a)), match_table[, 1])
not_matched_b <- collapse::`%!iin%`(seq(nrow(b)), match_table[, 2])
matches <- dplyr::bind_rows(a[not_matched_a,], b[not_matched_b,])
}
)
Expand Down

0 comments on commit 525310f

Please sign in to comment.