neighbours {gRapHD}R Documentation

Find all direct neighbours

Description

Find 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.

Details

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

Value

Vector with all neighbours of v.

Author(s)

Gabriel Coelho Goncalves de Abreu (Gabriel.Abreu@agrsci.dk)
Rodrigo Labouriau (Rodrigo.Labouriau@agrsci.dk)
David Edwards (David.Edwards@agrsci.dk)

Examples

  data(dsCont)
  m1 <- minForest(dsCont,homog=TRUE,forbEdges=NULL,stat="LR")
  neigh <- neighbours(edges=m1$edges, v=22)
  #    > neigh
  #    [1]  3  9 24 25

[Package gRapHD version 0.1.0 Index]