shift.left: Shift a matrix n columns to the left

Description Usage Arguments Value Note Author(s) Examples

View source: R/shift.left.R

Description

This function returns a matrix that has been shifted n columns to the left filling the subsqeuent columns with the given fill value

Usage

1
shift.left(A, cols = 1, fill = 0)

Arguments

A

a matrix

cols

integer number of columns to be shifted to the left

fill

the fill value which as as a default zero

Value

A matrix.

Note

If the argument A is not a numeric matrix, then the function presents an error message and stops. If the argument cols is not a positive integer, then the function presents an error message and stops.

Author(s)

Frederick Novomestky fnovomes@poly.edu

Examples

1
2
3
A <- matrix( seq( 1, 12, 1 ), nrow=3, byrow=TRUE )
shift.left( A, 1 )
shift.left( A, 2 )

matrixcalc documentation built on May 2, 2019, 1:45 p.m.