| DisplayGraph {BNArray} | R Documentation |
Display network from its named adjacent matrix
DisplayGraph(graph.matrix, colname.vec)
graph.matrix |
an adjacent matrix |
colname.vec |
the name of the adjacent matrix colnames(rownames) |
Directed network graph is displayed from its corresponding adjacent matrix with column and rownames. M[i,j]=1 denotes the node j is a parent of node i in graph G. Otherwise, M[i,j]=0.
No return value.
Xiaohui Chen cxh1984@interchange.ubc.ca,
Kaida Ning aprilnkd@hotmail.com,
Ming Chen mchen@zju.edu.cn.
m<-matrix(0,5,5)
m[1,2:5]<-1
m[2,3:5]<-1
m[3,4:5]<-1
m[4,5]<-1
rownames(m)<-paste("G",1:5,sep="")
colnames(m)<-paste("G",1:5,sep="")
DisplayGraph(m,rownames(m))