shift: Shift vector's elements

Description Usage Arguments Value Examples

View source: R/shift.R

Description

Shift vector's elements

Usage

1
shift(x, n = 1L, back = TRUE)

Arguments

x

A vector of values

n

A integer of length 1. x will shift by the number.

back

If TRUE, will shift x back by n.

Value

shifted x

Examples

1
2
3
4
shift(1:10)
shift(1:10, n = 3L)
shift(1:10, back = FALSE)
shift(1:10, n = -1L)

jundoll/jmisc documentation built on May 20, 2019, 4:24 a.m.