Skip to content

Commit

Permalink
Update centrality.R (#1418)
Browse files Browse the repository at this point in the history
  • Loading branch information
aviator-app[bot] committed Jul 2, 2024
2 parents 68fa712 + da60712 commit 4df9e02
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 7 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -72,5 +72,5 @@ Config/testthat/start-first: vs-es, scan, vs-operators, weakref,
watts.strogatz.game
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.1
RoxygenNote: 7.3.2
SystemRequirements: libxml2 (optional), glpk (>= 4.57, optional)
13 changes: 10 additions & 3 deletions R/centrality.R
Original file line number Diff line number Diff line change
Expand Up @@ -1439,6 +1439,15 @@ bonpow.sparse <- function(graph, nodes = V(graph), loops = FALSE,
#' theory motivates use of this measure, you should be very careful to choose a
#' decay parameter on a non-ad hoc basis.
#'
#' For directed networks, the Bonacich power measure can be understood as
#' similar to status in the network where higher status nodes have more edges
#' that point from them to others with status. Node A's centrality depends
#' on the centrality of all the nodes that A points toward, and their centrality
#' depends on the nodes they point toward, etc. Note, this means that a node
#' with an out-degree of 0 will have a Bonacich power centrality of 0 as they
#' do not point towards anyone. When using this with directed network it
#' is important to think about the edge direction and what it represents.
#'
#' @param graph the input graph.
#' @param nodes vertex sequence indicating which vertices are to be included in
#' the calculation. By default, all vertices are included.
Expand All @@ -1458,9 +1467,7 @@ bonpow.sparse <- function(graph, nodes = V(graph), loops = FALSE,
#' @note This function was ported (i.e. copied) from the SNA package.
#' @section Warning : Singular adjacency matrices cause no end of headaches for
#' this algorithm; thus, the routine may fail in certain cases. This will be
#' fixed when I get a better algorithm. `power_centrality()` will not symmetrize your
#' data before extracting eigenvectors; don't send this routine asymmetric
#' matrices unless you really mean to do so.
#' fixed when we get a better algorithm.
#' @author Carter T. Butts
#' (<http://www.faculty.uci.edu/profile.cfm?faculty_id=5057>), ported to
#' igraph by Gabor Csardi \email{csardi.gabor@@gmail.com}
Expand Down
13 changes: 10 additions & 3 deletions man/power_centrality.Rd

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

0 comments on commit 4df9e02

Please sign in to comment.