Apply Vector Translation To Point Pattern
Applies a vector shift to a point pattern.
## S3 method for class 'ppp': shift(X, vec=c(0,0), ..., origin=NULL)
- Point pattern (object of class
- Vector of length 2 representing a translation.
- Character string determining a location
that will be shifted to the origin. Options are
"bottomleft". Partially matched.
The point pattern, and its window, are
translated by the vector
This is a method for the generic function
origin is given, then it should be one of the character
vec will be ignored; instead the shift will be performed
so that the specified geometric location is shifted to the origin.
origin="centroid" then the centroid of the window will be
shifted to the origin. If
origin="midpoint" then the centre of
the bounding rectangle of the window will be shifted to the origin.
origin="bottomleft" then the bottom left corner of the
bounding rectangle of the window will be shifted to the origin.
- Another point pattern (of class
"ppp") representing the result of applying the vector shift.
data(cells) X <- shift(cells, c(2,3)) plot(X) # no discernible difference except coordinates are different plot(cells, pch=16) plot(shift(cells, c(0.03,0.03)), add=TRUE) shift(cells, origin="mid")