Skip to content
Open
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
2 changes: 1 addition & 1 deletion .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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
3 changes: 1 addition & 2 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
12 changes: 6 additions & 6 deletions R/centrality.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion R/graph_measures.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions man/centrality.Rd

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