50% off: Unlimited data and AI learning.
State of Data and AI Literacy Report 2025

scidb (version 1.1-2)

lag: lag

Description

Lag or lead a time series

Usage

## S3 method for class 'scidb':
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
x <- build("i",dim=10,names=c("x","i"),start=1,type="double")
y <- lag(x)
merge(x,y,by="i",all=TRUE)

Run the code above in your browser using DataLab