Learn R Programming

matrixcalc (version 1.0-6)

shift.down: Shift matrix m rows down

Description

This function returns a matrix that has had its rows shifted downwards filling the above rows with the given fill value.

Usage

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

Value

A matrix.

Arguments

A

a matrix

rows

the number of rows to be shifted

fill

the fill value which as a default is zero

Author

Frederick Novomestky fnovomes@poly.edu

Examples

Run this code
A <- matrix( seq( 1, 16, 1 ), nrow=4, byrow=TRUE )
shift.down( A, 1 )
shift.down( A, 3 )

Run the code above in your browser using DataLab