powered by
This function shifts the elements of an array to the right and the top.
shiftmat(x, dx = 0, dy = 0)
2D array.
Integer number. Number of grid points to shift the array to the north. Should be smaller than dim(x). Default is 0.
Integer number. Number of grid points to shift the array to the west. Should be smaller than dim(x). Default is 0.
Returns an array with shifted elements.
# NOT RUN { # shift the matrix dx = 1 and dy = 2 grid points x <- array(1:48, dim = c(6, 8)) xshift <- shiftmat(x = x, dx = 1, dy = 2) # }
Run the code above in your browser using DataLab