| shift {secr} | R Documentation |
Translate an array of points.
shift (object, shiftxy, ...)
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) |
This is a generic function. The default method is redundant, but the method for traps objects may be useful.
A matrix with the location of each point shifted by the desired amount.
Murray Efford murray.efford@otago.ac.nz
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)