diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 537bac2..9d8062d 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -54,7 +54,7 @@ jobs: - uses: r-lib/actions/setup-r-dependencies@v2 with: - extra-packages: any::rcmdcheck + extra-packages: any::rcmdcheck, igraph/rigraph needs: check - uses: r-lib/actions/check-r-package@v2 diff --git a/DESCRIPTION b/DESCRIPTION index e34c583..e00bfaa 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -18,7 +18,7 @@ BugReports: https://github.com/thomasp85/tidygraph/issues Imports: cli, dplyr (>= 0.8.5), - igraph (>= 2.0.0), + igraph (>= 2.0.3.9045), lifecycle, magrittr, pillar, @@ -45,5 +45,7 @@ LinkingTo: cpp11 Encoding: UTF-8 Roxygen: list(markdown = TRUE) -RoxygenNote: 7.3.1 +RoxygenNote: 7.3.2 Config/testthat/edition: 3 +Remotes: + igraph/rigraph diff --git a/NAMESPACE b/NAMESPACE index 91c712c..2768a98 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -471,7 +471,6 @@ importFrom(igraph,as_data_frame) importFrom(igraph,as_edgelist) importFrom(igraph,assortativity) importFrom(igraph,assortativity_nominal) -importFrom(igraph,authority_score) importFrom(igraph,betweenness) importFrom(igraph,bfs) importFrom(igraph,bibcoupling) @@ -538,7 +537,7 @@ importFrom(igraph,gsize) importFrom(igraph,harmonic_centrality) importFrom(igraph,has_eulerian_cycle) importFrom(igraph,has_eulerian_path) -importFrom(igraph,hub_score) +importFrom(igraph,hits_scores) importFrom(igraph,induced_subgraph) importFrom(igraph,is_bipartite) importFrom(igraph,is_chordal) diff --git a/R/centrality.R b/R/centrality.R index e96cf24..5a4f7cc 100644 --- a/R/centrality.R +++ b/R/centrality.R @@ -60,15 +60,15 @@ centrality_alpha <- function(weights = NULL, alpha = 1, exo = 1, tol = 1e-7, loo exo <- eval_tidy(exo, .N()) alpha_centrality(graph = graph, nodes = focus_ind(graph, 'nodes'), alpha = alpha, exo = exo, weights = weights, tol = tol, loops = loops) } -#' @describeIn centrality Wrapper for [igraph::authority_score()] -#' @importFrom igraph authority_score arpack_defaults +#' @describeIn centrality Wrapper for [igraph::hits_scores()] +#' @importFrom igraph hits_scores arpack_defaults #' @export centrality_authority <- function(weights = NULL, scale = TRUE, options = arpack_defaults()) { expect_nodes() weights <- enquo(weights) weights <- eval_tidy(weights, .E()) %||% NA graph <- .G() - authority_score(graph = graph, scale = scale, weights = weights, options = options)$vector[focus_ind(graph, 'nodes')] + hits_scores(graph = graph, scale = scale, weights = weights, options = options)$authority[focus_ind(graph, 'nodes')] } #' @describeIn centrality Wrapper for [igraph::betweenness()] #' @importFrom igraph V betweenness @@ -113,15 +113,15 @@ centrality_eigen <- function(weights = NULL, directed = FALSE, scale = TRUE, opt graph <- .G() eigen_centrality(graph = graph, directed = directed, scale = scale, weights = weights, options = options)$vector[focus_ind(graph, 'nodes')] } -#' @describeIn centrality Wrapper for [igraph::hub_score()] -#' @importFrom igraph hub_score arpack_defaults +#' @describeIn centrality Wrapper for [igraph::hits_scores()] +#' @importFrom igraph hits_scores arpack_defaults #' @export centrality_hub <- function(weights = NULL, scale = TRUE, options = arpack_defaults()) { expect_nodes() weights <- enquo(weights) weights <- eval_tidy(weights, .E()) %||% NA graph <- .G() - hub_score(graph = graph, scale = scale, weights = weights, options = options)$vector[focus_ind(graph, 'nodes')] + hits_scores(graph = graph, scale = scale, weights = weights, options = options)$hub[focus_ind(graph, 'nodes')] } #' @describeIn centrality Wrapper for [igraph::page_rank()] #' @importFrom igraph V page_rank diff --git a/R/graph_measures.R b/R/graph_measures.R index 837bccb..66c69e0 100644 --- a/R/graph_measures.R +++ b/R/graph_measures.R @@ -112,7 +112,7 @@ graph_girth <- function() { #' @export graph_radius <- function(mode = 'out') { graph <- .G() - radius(graph, mode) + radius(graph, mode = mode) } #' @describeIn graph_measures Counts the number of mutually connected nodes. Wraps [igraph::dyad_census()] #' @importFrom igraph dyad_census diff --git a/man/centrality.Rd b/man/centrality.Rd index 92dffe9..a51bbe1 100644 --- a/man/centrality.Rd +++ b/man/centrality.Rd @@ -201,7 +201,7 @@ all only work on undirected graphs. \itemize{ \item \code{centrality_alpha()}: Wrapper for \code{\link[igraph:alpha_centrality]{igraph::alpha_centrality()}} -\item \code{centrality_authority()}: Wrapper for \code{\link[igraph:hub_score]{igraph::authority_score()}} +\item \code{centrality_authority()}: Wrapper for \code{\link[igraph:hits_scores]{igraph::hits_scores()}} \item \code{centrality_betweenness()}: Wrapper for \code{\link[igraph:betweenness]{igraph::betweenness()}} @@ -211,7 +211,7 @@ all only work on undirected graphs. \item \code{centrality_eigen()}: Wrapper for \code{\link[igraph:eigen_centrality]{igraph::eigen_centrality()}} -\item \code{centrality_hub()}: Wrapper for \code{\link[igraph:hub_score]{igraph::hub_score()}} +\item \code{centrality_hub()}: Wrapper for \code{\link[igraph:hits_scores]{igraph::hits_scores()}} \item \code{centrality_pagerank()}: Wrapper for \code{\link[igraph:page_rank]{igraph::page_rank()}}