shiftmat: Shifts the elements of a matrix

Description Usage Arguments Value Author(s) Examples

View source: R/shiftmat.R

Description

This function shifts the elements of an array to the right and the top.

Usage

1
shiftmat(x, dx = 0, dy = 0)

Arguments

x

2D array.

dx

Integer number. Number of grid points to shift the array to the north. Should be smaller than dim(x). Default is 0.

dy

Integer number. Number of grid points to shift the array to the west. Should be smaller than dim(x). Default is 0.

Value

Returns an array with shifted elements.

Author(s)

Sebastian Brune

Examples

1
2
3
# 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) 

calcWOI documentation built on March 31, 2020, 5:21 p.m.