R/nb_node.R

Defines functions nb_node

Documented in nb_node

#' Number of nodes of in a graph
#'
#' Number of nodes of a graph.
#' @param graph an igraph object.
#'
#' @return integer: the number of node of the graph.
#' @export
#'
#' @examples
#' data(aleutian)
#' 
#' nb_node(aleutian)
#' @references Delmas, E., Besson, M., Brice, M.-H., Burkle, L. A., Dalla Riva, G. V., Fortin, M.-J., … Poisot, T. (2019). Analysing ecological networks of species interactions. Biological Reviews.
nb_node <- function(graph){

  stopifnot(class(graph) == "igraph")

  return(igraph::gorder(graph))
}
clementviolet/omnivor documentation built on Aug. 16, 2019, 12:05 a.m.