R/mat_to_el.R

Defines functions mat_to_el

#' Transform a matrix into an edge list
#' @param x an object of class \code{matrix}: adjacency matrix
#' @return an object of class \code{data.frame} edge list
#' @keywords internal
#' @noRd
mat_to_el <- function(x){
  delta <- row(x) - col(x)
  t(x)[which(delta != 0)]
}

Try the econet package in your browser

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

econet documentation built on April 28, 2022, 1:07 a.m.