shift: A tool for shifting a categorical map horizontally or vertically on a torus
Description
Use this function to shift a categorical map by a specified number of pixels up, down, left, or right. The shifted pixels are wrapped around to the opposite edge of the map.
Usage
shift(map = demoimage1, dir = 1, n = 1, draw = TRUE, verbose = TRUE)
Arguments
map
A required input categorical map as a matrix. Currently, the requirement is that the x and y dimensions are equal.
dir
An integer (1,2,3, or 4) that identifies the shift direction: up, right, down, or left respectively.
n
The number of pixels to shift.
draw
A boolean flag indicating whether results will be drawn to the graphics window.
verbose
A boolean flag indicating whether verbose feedback is provided to standard output.
Value
If valid parameters are set, the output will be the shifted map object as a matrix. Otherwise, error messages are provided and NULL is returned.