Learn R Programming

spatstat (version 1.11-4)

shift.ppp: Apply Vector Translation To Point Pattern

Description

Applies a vector shift to a point pattern.

Usage

## S3 method for class 'ppp':
shift(X, vec=c(0,0), ...)

Arguments

X
Point pattern (object of class "ppp").
vec
Vector of length 2 representing a translation.
...
Ignored

Value

  • Another point pattern (of class "ppp") representing the result of applying the vector shift.

Details

The point pattern, and its window, are translated by the vector vec. This is a method for the generic function shift.

See Also

shift, shift.owin, rotate, affine

Examples

Run this code
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)

Run the code above in your browser using DataLab