shift.up: Shift matrix m rows up

View source: R/shift.up.R

shift.upR Documentation

Shift matrix m rows up

Description

This function returns a matrix where the argument as been shifted up the given number of rows filling the bottom rows with the given fill value.

Usage

shift.up(A, rows = 1, fill = 0)

Arguments

A

a matrix

rows

integer number of rows

fill

fill value which as the default value of 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 rows is not a positive integer, then the function presents an error message and stops.

Author(s)

Frederick Novomestky fnovomes@poly.edu

Examples

A <- matrix( seq( 1, 16, 1 ), nrow=4, byrow=TRUE )
shift.up( A, 1 )
shift.up( A, 3 )

matrixcalc documentation built on Sept. 15, 2022, 1:05 a.m.