shift: function that shifts vector values to right or left

Description Usage Arguments

View source: R/tools.R

Description

function that shifts vector values to right or left

Usage

1
shift(x, n = 0, default = NA, invert = FALSE)

Arguments

x

Vector for which to shift values

n

Number of places to be shifted. Positive numbers will shift to the right by default. Negative numbers will shift to the left by default. The direction can be inverted by the invert parameter.

default

The value that should be inserted by default.

invert

Whether or not the default shift directions should be inverted.


rtext documentation built on Jan. 28, 2021, 9:05 a.m.

Related to shift in rtext...