Learn R Programming

gRapHD (version 0.2.5)

neighbours: Finds all direct neighbours

Description

Finds all direct neighbours of a given vertex in a given graph.

Usage

neighbours(model=NULL,edges=NULL,v)

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

reference vertex.

Value

Vector with all neighbours of vertex v.

Details

Returns all vertices with a direct connection with vertex v in edges.

Examples

Run this code
# NOT RUN {
data(dsCont)
m1 <- minForest(dsCont,homog=TRUE,forbEdges=NULL,stat="LR")
neigh <- neighbours(edges=m1@edges, v=22)
#    > neigh
#    [1]  3  9 24 25
# }

Run the code above in your browser using DataLab