reshapeTs {DGM}R Documentation

Reshapes a 2D concatenated time series into 3D according to no. of subjects and volumes.

Description

Reshapes a 2D concatenated time series into 3D according to no. of subjects and volumes.

Usage

reshapeTs(ts, N, V)

Arguments

ts

a 2D time series volumes x nodes.

N

No. of subjects.

V

No. of volumes.

Value

M 3D matrix, time series x nodes x subjects.

Examples

# Let's say subjects are concatenated in a 2D matrix
# (samples x nodes), with each having 200 samples.
# generate some sample data
N=20
Nn=5
x = array(rnorm(200*N*Nn), dim=c(200*N,Nn))
ts = reshapeTs(x,N,200)


[Package DGM version 1.7.4 Index]