Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix deprecation warning from igraph #109

Merged
merged 1 commit into from
Feb 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.

Loading