R/igraphtoGNAR.R

Defines functions igraphtoGNAR

Documented in igraphtoGNAR

igraphtoGNAR <- function(ig){
  stopifnot(is.igraph(ig))
  if(is.weighted(ig)){
    weimat <- get.adjacency(ig, attr="weight")
  }else{
    weimat <- get.adjacency(ig)
    weimat <- as.matrix(weimat)
  }
  net <- matrixtoGNAR(weimat)
  return(net)
}

Try the GNAR package in your browser

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

GNAR documentation built on April 28, 2023, 1:12 a.m.