frommatrix: Converts a backbone adjacency matrix to a graph object of...

View source: R/utils.R

frommatrixR Documentation

Converts a backbone adjacency matrix to a graph object of specified class

Description

Converts a backbone adjacency matrix to a graph object of specified class

Usage

frommatrix(mat, attribs = NA, convert = "matrix")

Arguments

mat

an adjacency matrix

attribs

dataframe: vertex attributes to be assigned in igraph object

convert

class to convert to, one of "matrix", "Matrix", "igraph", or "edgelist"

Value

backbone graph: Binary or signed backbone graph of class convert.

Examples

M <- matrix(sample(c(-1,0,1),5*5,replace=TRUE),5,5)
test <- backbone:::frommatrix(M, "Matrix")

backbone documentation built on May 29, 2024, 8:03 a.m.