shift.left: Shift vector elements to the left

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/r-utility-shift.R

Description

This function shifts vector elements to the left, filling the new last position with a specified value. It is used in examples presented in the book Cichosz, P. (2015): Data Mining Algorithms: Explained Using R. See Appendix B or http://www.wiley.com/go/data_mining_algorithms for more details.

Usage

1
shift.left(v, last = NA)

Arguments

v

a vector

last

a value to be inserted at the last position after shifting

Details

All vector elements are shifted to the left: the original v[1] disappears, the original v[2] becomes the new v[1], etc. The new v[length(v)] value is set to last (defaulting to NA).

Value

The shifted version of v.

Author(s)

Pawel Cichosz <p.cichosz@elka.pw.edu.pl>

See Also

shift.right

Examples

1
shift.left(1:10)

42n4/dmr.util documentation built on May 20, 2019, 2:02 p.m.