Learn R Programming

aion (version 1.7.0)

flip: Transposition

Description

Transposes a time series object by permuting its dimensions and resizing it.

Usage

flip(x, ...)

# S4 method for TimeSeries flip(x)

Value

A permuted (\(n \times p \times m\)) TimeSeries object.

Arguments

x

A \(n \times m \times p\) TimeSeries object.

...

Currently not used.

Author

N. Frerebeau

See Also

Other mutators: as.data.frame(), labels(), length(), names(), subset()

Examples

Run this code
## Create 6 x 3 time-series of 50 observations
## Sampled every two years starting from 2000 BP
X <- series(
  object = array(rnorm(900), dim = c(50, 6, 3)),
  time = seq(2000, by = 2, length.out = 50),
  calendar = BP()
)
plot(X, calendar = BP())

## Permute dimensions 2 and 3
## 3 x 6 time-series of 50 observations
Y <- flip(X)
plot(Y, calendar = BP())

Run the code above in your browser using DataLab