as.foldert.array: Data frame to foldert

View source: R/as.foldert.array.r

as.foldert.arrayR Documentation

Data frame to foldert

Description

Builds an object of class foldert from a 3d-array.

Usage

## S3 method for class 'array'
as.foldert(x, ind = 1, var = 2, time = 3, ...)

Arguments

x

a 3d-array.

ind, var, time

three distinct integers among 1, 2 and 3.

ind gives the dimension of the observations, var gives the dimension of the variables and ind gives the dimension of the times.

...

further arguments passed to or from other methods.

Value

an object ft of class foldert that is a list of data frames, each of them corresponding to a time of observation; these data frames have the same column names.

They necessarily have the same row names (attr(ft, "same.rows")=TRUE). The "times" attribute of ft: attr(ft, "times") is a numeric vector, an ordered factor or an object of class Date, and contains the values nf the dimension of x given by time argument.

Author(s)

Rachid Boumaza, Pierre Santagostini, Smail Yousfi, Gilles Hunault, Sabine Demotes-Mainard

See Also

foldert: objects of class foldert.

as.foldert.data.frame: build an object of class foldert from a data frame.

Examples

x <- array(c(rep(0, 5), rep(0, 5), rep(0, 5),
             rnorm(5, 2, 1), rnorm(5, 3, 2), rnorm(5, -2, 0.5),
             rnorm(5, 4, 1), rnorm(5, 5, 3), rnorm(5, -3, 1)),
           dim = c(5, 3, 3),
           dimnames = list(1:5, c("z1", "z2", "z3"), c("t1", "t2", "t3")))
# The individuals which were observed are on the 1st dimension,
# the variables are on the 2nd dimension and the times are on the 3rd dimension.
ft <- as.foldert(x, ind = 1, var = 2, time = 3)

dad documentation built on Aug. 30, 2023, 5:06 p.m.