R/mats_as_graphs.R

Defines functions mats_as_graphs

Documented in mats_as_graphs

#' Convert list of connectivity matrices to igraph objects
#'
#' This function converts a list of adjacency or correlation matrices to igraph objects.
#' @param cormats a list of matrices
#' @return A list of igraph objects
#' @export
#' @author Brandon Vaughan
#' @examples
#' graphs = mats_to_graphs(cormats)
#'
mats_as_graphs = function(cormats) {
  pbapply::pblapply(1:length(cormats), function(x) {graph.adjacency(cormats[[x]], weighted=T, mode="undirected", diag=TRUE)})
}
abnormally-distributed/rsfcNet documentation built on March 8, 2020, 5:32 p.m.