prev

Syntax

prev(X)

Arguments

X is a vector/matrix/table.

Details

Shift the elements of a vector to the right for one position. In comparison, next shifts the elements of a vector to the left for one position; move shifts the elements of a vector for multiple positions.

Examples

x=3 9 5 1 4;
prev(x);
// output: [,3,9,5,1]
x = matrix(1 2 3 4 5);
prev(x)#0
#0
1
2
3
4
t=table(1 2 3 as a, `x`y`z as b, 10.8 7.6 3.5 as c);
prev(t)
a b c
1 x 10.8
2 y 7.6