Learn R Programming

secr (version 1.3.0)

shift: Shift Points

Description

Translate an array of points.

Usage

shift (object, shiftxy, ...)

Arguments

object
a 2-column matrix or object that can be coerced to a matrix
shiftxy
vector of x and y displacements
...
other arguments (not used)

Value

  • A matrix with the location of each point shifted by the desired amount.

Details

This is a generic function. The default method is redundant, but the method for traps objects may be useful.

See Also

rotate, flip

Examples

Run this code
temp <- matrix(runif (20) * 2 - 1, nc = 2)
temp2 <- shift(temp, c(0.1, 0.1))
plot(temp, xlim=c(-1.5,1.5), ylim = c(-1.5,1.5), pch = 16)
points (0,0, pch=2)
points (temp2, pch = 1)
arrows (temp[,1], temp[,2], temp2[,1], temp2[,2], length = 0.1)

Run the code above in your browser using DataLab