Skip to content

Commit

Permalink
Fix documentation of the return value of metrics.hub.degree
Browse files Browse the repository at this point in the history
There can be multiple vertices with maximum degree. This is clarified now in
the documentation of the return value of `metrics.hub.degree`. In addition,
also document that `NA` is returned if the network is empty (instead of
a data.frame).

Signed-off-by: Thomas Bock <bockthom@cs.uni-saarland.de>
  • Loading branch information
bockthom committed Apr 13, 2023
1 parent 23d0361 commit ac52407
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions util-networks-metrics.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
##
## Copyright 2015, 2019 by Thomas Bock <bockthom@fim.uni-passau.de>
## Copyright 2021 by Thomas Bock <bockthom@cs.uni-saarland.de>
## Copyright 2021, 2023 by Thomas Bock <bockthom@cs.uni-saarland.de>
## Copyright 2017 by Raphael Nömmer <noemmer@fim.uni-passau.de>
## Copyright 2017-2019 by Claus Hunsen <hunsen@fim.uni-passau.de>
## Copyright 2017-2018 by Christian Hechtl <hechtl@fim.uni-passau.de>
Expand All @@ -36,7 +36,8 @@ requireNamespace("igraph")
#' @param network the network to be examined
#' @param mode the mode to be used for determining the degrees [default: "total"]
#'
#' @return A data frame containing the name of the vertex with with maximum degree its degree.
#' @return If the network is empty (i.e., has no vertices), \code{NA}.
#' Otherwise, a data frame containing the name of the vertex/vertices with maximum degree and its/their degree.
metrics.hub.degree = function(network, mode = c("total", "in", "out")) {
## check whether the network is empty, i.e., if it has no vertices
if (igraph::vcount(network) == 0) {
Expand Down

0 comments on commit ac52407

Please sign in to comment.