From ff74cd0e397e754abd221a3485e92e6fcfb05c37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlle=20Salmon?= Date: Wed, 17 Jul 2024 08:49:47 +0200 Subject: [PATCH 1/5] ci: use dev igraph --- DESCRIPTION | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index e34c583..0fc6d48 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, @@ -47,3 +47,5 @@ Encoding: UTF-8 Roxygen: list(markdown = TRUE) RoxygenNote: 7.3.1 Config/testthat/edition: 3 +Remotes: + igraph/rigraph From 4c36b9eda9b435c09f2e765fa9f0c43f5beeee72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlle=20Salmon?= Date: Wed, 17 Jul 2024 08:50:23 +0200 Subject: [PATCH 2/5] refactor: use igraph::hit_score() instead of deprecated igraph::authority_score() --- DESCRIPTION | 4 ++-- NAMESPACE | 2 +- R/centrality.R | 6 +++--- man/centrality.Rd | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 0fc6d48..e00bfaa 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -45,7 +45,7 @@ LinkingTo: cpp11 Encoding: UTF-8 Roxygen: list(markdown = TRUE) -RoxygenNote: 7.3.1 +RoxygenNote: 7.3.2 Config/testthat/edition: 3 -Remotes: +Remotes: igraph/rigraph diff --git a/NAMESPACE b/NAMESPACE index 91c712c..ccaee1b 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,6 +537,7 @@ importFrom(igraph,gsize) importFrom(igraph,harmonic_centrality) importFrom(igraph,has_eulerian_cycle) importFrom(igraph,has_eulerian_path) +importFrom(igraph,hits_scores) importFrom(igraph,hub_score) importFrom(igraph,induced_subgraph) importFrom(igraph,is_bipartite) diff --git a/R/centrality.R b/R/centrality.R index e96cf24..d21333d 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 diff --git a/man/centrality.Rd b/man/centrality.Rd index 92dffe9..9e63959 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()}} From c67c04e83303c20026b7176fac50eb947799be8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlle=20Salmon?= Date: Wed, 17 Jul 2024 09:06:01 +0200 Subject: [PATCH 3/5] refactor: use igraph::hit_scores() instead of deprecated igraph::hub_score() --- NAMESPACE | 1 - R/centrality.R | 6 +++--- man/centrality.Rd | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/NAMESPACE b/NAMESPACE index ccaee1b..2768a98 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -538,7 +538,6 @@ importFrom(igraph,harmonic_centrality) importFrom(igraph,has_eulerian_cycle) importFrom(igraph,has_eulerian_path) importFrom(igraph,hits_scores) -importFrom(igraph,hub_score) importFrom(igraph,induced_subgraph) importFrom(igraph,is_bipartite) importFrom(igraph,is_chordal) diff --git a/R/centrality.R b/R/centrality.R index d21333d..5a4f7cc 100644 --- a/R/centrality.R +++ b/R/centrality.R @@ -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/man/centrality.Rd b/man/centrality.Rd index 9e63959..a51bbe1 100644 --- a/man/centrality.Rd +++ b/man/centrality.Rd @@ -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()}} From 2f3995764ecdab749bfb17a3b53c9850dc2f9308 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlle=20Salmon?= Date: Wed, 17 Jul 2024 09:10:17 +0200 Subject: [PATCH 4/5] refactor: explicitly use mode argument in call to igraph::radius() --- R/graph_measures.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From d4c1585faa28f6f4f7cca8222039469e58822076 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlle=20Salmon?= Date: Wed, 17 Jul 2024 12:15:47 +0200 Subject: [PATCH 5/5] ci: try another way to indicate dev dep --- .github/workflows/R-CMD-check.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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