Learn R Programming

gRapHD (version 0.2.5)

SubGraph: Generates a subgraph

Description

Generates a sub-graph.

Usage

SubGraph(model=NULL,edges=NULL,v=NULL,p=0)

Arguments

model

gRapHD object.

edges

matrix with 2 columns, each row representing one edge, and each column one of the vertices in the edge.

v

list of vertices in the sub-graph.

p

Number of vartices (used only if edges is not NULL).

Value

Returns a gRapHD object, in which the edge list contains only edges where both vertices are in v.

Details

Based on a list of vertices, generate a sub-graph.

Examples

Run this code
# NOT RUN {
data(dsCont)
m1 <- minForest(dsCont,homog=TRUE,forbEdges=NULL,stat="LR")
plot(m1,numIter=1000)

v <- c(1,11,21,19,30,25,22,24,34,9,20,29)
subM1 <- SubGraph(model=m1,v=v)
plot(subM1,numIter=1500)
# }

Run the code above in your browser using DataLab