Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

shift

function that shifts vector values to right or left


Description

function that shifts vector values to right or left

Usage

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

R6 Objects for Text and Data

v0.1.22
MIT + file LICENSE
Authors
Peter Meissner [aut, cre], Ulrich Sieberer [cph], University of Konstanz [cph]
Initial release
2021-01-27

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.