shift.vector: Shift a vector left or right.

View source: R/utils.R

shift.vectorR Documentation

Shift a vector left or right.

Description

Simple function to move the elements of a vector to earlier or later positions depending on the value of shift. Auxiliary to other functions, rather multipurpose.

Usage

shift.vector(x, shift = 0, fill = FALSE)

Arguments

x

vector.

shift

integer. Value < length(x). Default 0.

fill

Values to fill newly created positions, e.g. FALSE, NA, or 0.

Details

Nothing fancy here. This is used for example in Noumbissi() to match denominator ranges to numerator positions using logical vectors.

Value

The vector x, shifted left or right.


timriffe/DemoTools documentation built on Jan. 28, 2024, 5:13 a.m.