frommatrix {backbone} | R 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")
[Package backbone version 2.1.4 Index]