m2graph {BiDAG}R Documentation

Deriving a graph from an adjacancy matrix

Description

This function derives a graph object corresponding to an adjacency matrix

Usage

m2graph(adj, nodes = NULL)

Arguments

adj

square adjacency matrix with elements in {0,1}, representing a graph

nodes

(optional) labels of the nodes, c(1:n) are used by default

Value

object of class graphNEL (package ‘graph’); if element adj[i,j] equals 1, then there is a directed edge from node i to node j in the graph, and no edge otherwise

Examples

m2graph(Asiamat)

[Package BiDAG version 2.0.4 Index]