Skip to content

Commit

Permalink
Fix deprecation warning from igraph (#109)
Browse files Browse the repository at this point in the history
  • Loading branch information
etiennebacher authored Feb 13, 2024
1 parent b5560bd commit c46c95f
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
10 changes: 5 additions & 5 deletions R/euclidean_logical_joins.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
#' about the distance and not the similarity. Therefore, a lower value means a
#' higher similarity.
#' @param r Hyperparameter used to govern the sensitivity of the locality
#' sensitive hash. Corresponds to the width of the hash bucket in the LSH
#' algorithm. Increasing values of `r` mean more hash collisions and higher
#' sensitivity (fewer false-negatives) at the cost of lower specificity (more
#' false-positives and longer run time). For more information, see the
#' description in <doi:10.1145/997817.997857>.
#' sensitive hash. Corresponds to the width of the hash bucket in the LSH
#' algorithm. Increasing values of `r` mean more hash collisions and higher
#' sensitivity (fewer false-negatives) at the cost of lower specificity (more
#' false-positives and longer run time). For more information, see the
#' description in \doi{10.1145/997817.997857}.
#'
#' @return A tibble fuzzily-joined on the basis of the variables in `by.` Tries
#' to adhere to the same standards as the dplyr-joins, and uses the same
Expand Down
9 changes: 7 additions & 2 deletions R/string_group.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#' Fuzzy String Grouping Using Minhashing
#'
#' Performs fuzzy string grouping in which similar strings are assigned to the
#' same group. Uses the `fastgreedy.community` community detection algorithm
#' same group. Uses the `cluster_fast_greedy()` community detection algorithm
#' from the `igraph` package to create the groups. Must have igraph installed
#' in order to use this function.
#'
Expand Down Expand Up @@ -67,7 +67,12 @@ jaccard_string_group <- function(string, n_gram_width = 2, n_bands = 45, band_wi


graph <- igraph::graph_from_edgelist(pairs)
fc <- igraph::fastgreedy.community(igraph::as.undirected(graph))
if (packageVersion("igraph") < "2.0.0") {
fc <- igraph::fastgreedy.community(igraph::as.undirected(graph))
} else {
fc <- igraph::cluster_fast_greedy(igraph::as.undirected(graph))
}


groups <- igraph::groups(fc)
lookup_table <- vapply(groups, "[[", integer(1), 1)
Expand Down
2 changes: 1 addition & 1 deletion man/euclidean-joins.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/jaccard_string_group.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c46c95f

Please sign in to comment.