R/degree.collect.R

Defines functions degree.collect

Documented in degree.collect

#' Degrees of nodes
#'
#' @description Collect the degrees for all nodes in a network.
#' @param net	 The input network.
#' @details Obtain the degrees for all nodes.
#' @return A vector.
#' @author Xu Dong, Nazrul Shaikh.
#' @examples \dontrun{
#  x <-  net.erdos.renyi.gnp(1000, 0.01)
#' x.deg <- degree.collect(x)
#' summary(x.deg)}
#' @export

degree.collect <- function(net){

  lengths(net)

}

Try the fastnet package in your browser

Any scripts or data that you put into this service are public.

fastnet documentation built on Jan. 13, 2021, 5:28 p.m.