array2longitudinal: Convert a time-series array to a longitudinal-object.

Description Usage Arguments Value Author(s) See Also Examples

View source: R/array2longitudinal.r

Description

Converts a 3-dim array (containing time-series data of multiple individuals) to an object of that can directly be converted to the longitudinal class through the as.longitudinal function.

Usage

1
array2longitudinal(Y, keepMissings=TRUE)

Arguments

Y

Three-dimensional array containing the data. The first, second and third dimensions correspond to covariates, time and samples, respectively.

keepMissings

The array-format assumes a balanced layout of the time-course experiment. The experiment may have failed for some design points and no data is available. In the longitudinal-format these design points may be left out. This logical indicates whether they should be kept in (or not).

Value

A longitudinal-object containing time-series data.

Author(s)

Wessel N. van Wieringen <w.vanwieringen@vumc.nl>

See Also

dataVAR1, longitudinal, longitudinal2array, as.longitudinal.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# set dimensions (p=covariates, n=individuals, T=time points)
p <- 3; n <- 4; T <- 10

# set model parameters
SigmaE <- diag(p)/4
A      <- createA(p, "chain")

# generate data
Y <- dataVAR1(n, T, A, SigmaE)

# convert to longitudinal
Ylongitudinal <- array2longitudinal(Y)

wvanwie/ragt2ridges documentation built on May 4, 2019, 12:03 p.m.