Learn R Programming

scidb (version 1.2-0)

lag: lag

Description

Lag or lead a time series

Usage

"lag"(x, k=1, dim=1, `eval`=FALSE)

Arguments

x
A scidb array object.
k
Coordinate system units to lag by.
dim
SciDB array dimension to lag along.
eval
(Optional) If true, execute the query and store the reult array. Otherwise defer evaluation.

Value

A scidb array object with identical schema as x, but whose values are shifted along the coordinate axis dim by the lag value k.

See Also

scidb

Examples

Run this code
## Not run: 
# x <- build("i",dim=10,names=c("x","i"),start=1,type="double")
# y <- lag(x)
# merge(x,y,by="i",all=TRUE)
# ## End(Not run)

Run the code above in your browser using DataLab