Learn R Programming

netdiffuseR (version 1.17.0)

as.array.diffnet: Coerce a diffnet graph into an array

Description

Coerce a diffnet graph into an array

Usage

"as.array"(x, ...)

Arguments

x
A diffnet object.
...
Ignored.

Value

A three-dimensional array of $T$ matrices of size $n * n$.

Details

The function takes the list of sparse matrices stored in x and creates an array with them. Attributes and other elements from the diffnet object are dropped.

dimnames are obtained from the metadata of the diffnet object.

See Also

diffnet.

Other diffnet methods: %*%, as_diffnet, c.diffnet, diffnet-arithmetic, diffnet_index

Examples

Run this code
# Creating a random diffnet object
set.seed(84117)
mydiffnet <- rdiffnet(30, 5)

# Coercing it into an array
as.array(mydiffnet)

Run the code above in your browser using DataLab