Learn R Programming

gRapHD (version 0.2.5)

adjMat: Adjacency matrix

Description

Returns the adjacency matrix based on a list of edges, supplied in a gRapHD object or as a matrix.

Usage

adjMat(model=NULL,edges=NULL,p=NULL)

Arguments

model

gRapHD object.

edges

matrix with 2 columns, each row representing one edge, and each column one of the vertices in the edge. Column 1 contains the vertex with lower index.

p

number of vertices.

Value

matrix

p by p.

Details

The dimension of the matrix is given by model$p or by the maximum value between max(edges) and p.

Examples

Run this code
# NOT RUN {
data(dsCont)
m1 <- minForest(dsCont,homog=TRUE,forbEdges=NULL,stat="LR")
edges <- SubGraph(edges=m1@edges,v=1:10)@edges
adjMat(edges=edges,p=10)
# }

Run the code above in your browser using DataLab