Skip to content

Commit

Permalink
removed netswan dependency (#203)
Browse files Browse the repository at this point in the history
  • Loading branch information
schochastics authored Feb 5, 2025
1 parent 382c2b7 commit 9a3385f
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 17 deletions.
3 changes: 1 addition & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ Suggests:
graph,
influenceR,
methods,
netrankr,
NetSwan,
netrankr (>= 1.2.4),
network,
seriation,
testthat (>= 3.0.0)
Expand Down
3 changes: 0 additions & 3 deletions R/aaa.R
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,3 @@ expect_netrankr <- function(...) {
expect_seriation <- function(...) {
rlang::check_installed('seriation', ...)
}
expect_netswan <- function(...) {
rlang::check_installed('NetSwan', ...)
}
18 changes: 9 additions & 9 deletions R/node.R
Original file line number Diff line number Diff line change
Expand Up @@ -267,27 +267,27 @@ node_effective_network_size <- function() {
graph <- .G()
influenceR::ens(graph)[focus_ind(graph, 'nodes')]
}
#' @describeIn node_measures measures the impact on connectivity when removing the node (`NetSwan`)
#' @describeIn node_measures measures the impact on connectivity when removing the node (`netrankr`)
#' @export
node_connectivity_impact <- function() {
expect_netswan()
expect_netrankr()
expect_nodes()
graph <- .G()
NetSwan::swan_connectivity(graph)[focus_ind(graph, 'nodes')]
netrankr::swan_connectivity(graph)[focus_ind(graph, 'nodes')]
}
#' @describeIn node_measures measures the impact on closeness when removing the node (`NetSwan`)
#' @describeIn node_measures measures the impact on closeness when removing the node (`netrankr`)
#' @export
node_closeness_impact <- function() {
expect_netswan()
expect_netrankr()
expect_nodes()
graph <- .G()
NetSwan::swan_closeness(graph)[focus_ind(graph, 'nodes')]
netrankr::swan_closeness(graph)[focus_ind(graph, 'nodes')]
}
#' @describeIn node_measures measures the impact on fareness (distance between all node pairs) when removing the node (`NetSwan`)
#' @describeIn node_measures measures the impact on fareness (distance between all node pairs) when removing the node (`netrankr`)
#' @export
node_fareness_impact <- function() {
expect_netswan()
expect_netrankr()
expect_nodes()
graph <- .G()
NetSwan::swan_efficiency(graph)[focus_ind(graph, 'nodes')]
netrankr::swan_efficiency(graph)[focus_ind(graph, 'nodes')]
}
6 changes: 3 additions & 3 deletions man/node_measures.Rd

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

0 comments on commit 9a3385f

Please sign in to comment.