Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

NofNeighbours

Calculates stage-neighbours of a network


Description

Calculates neighbour sets of a particular node in the network and their distances.

Usage

NofNeighbours(node=1, stage=2, net=GNAR::fiveNet)

Arguments

node

is an integer specifying which node to calculate the neighbours of.

stage

is an integer specifying the maximum neighbour-stage to calculate to.

net

a GNARnet object with edge list and distance list.

Details

Note that the distances are calculated as the sum along the shortest path; do not use this with a weights (rather than distance) list. Stage-r neighbours of node i are denoted N^(r) (i), and are nodes that are r edges (but no fewer) away from i. Hence stage-1 neighbours are the immediate neighbours, stage-2 neighbours are the neighbours of neighbours and so on.

Value

edges

is a list of length stage, where edges[[i]] is a vector containing the nodes that are stage-i neighbours of node.

dist

is a list of length stage, where dist[[i]] is a vector containing the distances from node to its stage-i neighbours, with ordering as in edges[[i]].

Examples

#First and second stage neighbours of node 1 in fiveNet
NofNeighbours()

GNAR

Methods for Fitting Network Time Series Models

v1.1.1
GPL-2
Authors
Kathryn Leeming [aut], Guy Nason [aut], Matt Nunes [aut, cre], Marina Knight [ctb]
Initial release
2020-11-10

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.