Learn R Programming

BiDAG (version 2.0.0)

m2graph: 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

Run this code
# NOT RUN {
m2graph(Asiamat)
# }

Run the code above in your browser using DataLab