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