powered by
This function returns a matrix that has been shifted to the right n columns filling the previous columns with the given fill value.
shift.right(A, cols = 1, fill = 0)
A matrix.
a matrix
integer number of columns to be shifted to the right
the fill which as default value zero
Frederick Novomestky fnovomes@poly.edu
A <- matrix( seq( 1, 16, 1 ), nrow=4, byrow=TRUE ) shift.right( A, 1 ) shift.right( A, 2 )
Run the code above in your browser using DataLab