shift.right | R Documentation |
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 |
a matrix |
cols |
integer number of columns to be shifted to the right |
fill |
the fill which as default value zero |
A matrix.
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.
Frederick Novomestky fnovomes@poly.edu
A <- matrix( seq( 1, 16, 1 ), nrow=4, byrow=TRUE ) shift.right( A, 1 ) shift.right( A, 2 )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.