Learn R Programming

backbone (version 2.1.0)

frommatrix: Converts a backbone adjacency matrix to an object of specified class

Description

Converts a backbone adjacency matrix to an object of specified class

Usage

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

Value

backbone graph: Binary or signed backbone graph of class given in parameter convert.

Arguments

graph

a matrix

attribs

dataframe: vertex attributes to be assigned in igraph object

convert

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

Examples

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

Run the code above in your browser using DataLab