shifter: Vector shifter

View source: R/utils.R

shifterR Documentation

Vector shifter

Description

Shift a vector left or right by a number of spaces. From: https://stackoverflow.com/a/30542172/1898713 library(SOfun); shifter(a)#'

Usage

shifter(x, n = 1)

Arguments

x

a numeric vector

n

an integer, the number of indices to shift the input vector. Positive, shifts left; negative, shifts right.

Value

a numeric vector

Examples

library(ARCOS)
ARCOS:::shifter(1:10, 2)

dmattek/ARCOS documentation built on Dec. 5, 2024, 11:02 p.m.