R/node_degree.R

Defines functions node_degree

Documented in node_degree

#' Calculate node degree
#'
#' The function calculates the node degree of a network 
#'
#' @param net numeric matrix   
#' 
#' @return node_degree numeric array 
#' 
#' @keywords node degree
#' network topology metric 
#' 
#' @examples
#' net <- cor( matrix(rnorm(1000), ncol=10)) 
#' n <- 10
#' net <- matrix(rank(net, na.last = 'keep', ties.method = 'average'), nrow = n, ncol = n)
#' net <- net/max(net, na.rm=TRUE)
#' nd <- node_degree(net)
#'  
#' @export
#'
node_degree <- function(net) {
    return(rowSums(net, na.rm = TRUE))
} 

Try the EGAD package in your browser

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

EGAD documentation built on Nov. 8, 2020, 8:31 p.m.