Learn R Programming

GNAR (version 0.2.9)

GNARtoWMat: Converts a GNAR network to a weighted adjacency matrix

Description

Takes an input GNARnet and neighbour stage and outputs the corresponding adjacency matrix.

Usage

GNARtoWMat(net=GNAR::fiveNet, stage=1, normalise=FALSE)

Arguments

net

a GNARnet object containing $edges and $dist.

stage

the neighbour set that the adjacency matrix is created for.

normalise

whether to normalise each to non-zero row to have sum one.

Value

GNARtoWMat returns a square matrix with the number of rows and columns equal to the length of the $edges list. Entry i,j of the matrix will be non-zero if node j is in the stage neighbour set of i.

Details

With normalisation this is a non-invertible transform. See NofNeighbours for neighbour set definition.

Examples

Run this code
# NOT RUN {
#fiveNet as an adjacency matrix
data(fiveNode)
GNARtoWMat()
# }

Run the code above in your browser using DataLab