as.matrix.GNARnet: Converts a GNAR networks into a weighted adjacency matrix

View source: R/as.matrix.GNARnet.R

as.matrix.GNARnetR Documentation

Converts a GNAR networks into a weighted adjacency matrix

Description

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

Usage

## S3 method for class 'GNARnet'
as.matrix(x, stage=1, normalise=FALSE, ...)

Arguments

x

the network GNARnet object associated with the time series, containing a list with entries $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.

...

additional arguments, unused here.

Details

S3 method for class "GNARnet".

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

Value

as.matrix performed on a GNARnet 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.

Examples

#fiveNet as an adjacency matrix
as.matrix(fiveNet)

GNAR documentation built on April 28, 2023, 1:12 a.m.

Related to as.matrix.GNARnet in GNAR...