shiftPositions: Shift a Positions Object

Description Usage Arguments Value See Also Examples

Description

Returns a positions object similar to the input but shifted in time.

Usage

1

Arguments

x

a vector or timeDate object. Missing values (NAs) are allowed.

k

the number of positions the input series is to shift for the new series.

  • If k is a positive value, the resulting series is shifted forwards in time.

  • If k is a negative value, the resulting series is shifted backwards in time.

If k is a non-integer value, it is rounded to the nearest integer before the shift is applied.

Value

returns a vector or timeDate object with the positions shifted by k steps.

See Also

lag

Examples

1
2
3
shiftPositions(1:10, 1)
x <- as(1:10, "timeDate")
shiftPositions(x)

splusTimeDate documentation built on May 29, 2017, 9:38 p.m.

Search within the splusTimeDate package
Search all R packages, documentation and source code