Make Periodic Copies of a Spatial Pattern
Given a spatial pattern (point pattern, line segment pattern, window, etc) make shifted copies of the pattern and optionally combine them to make a periodic pattern.
periodify(X, ...) ## S3 method for class 'ppp' periodify(X, nx = 1, ny = 1, ..., combine=TRUE, warn=TRUE, check=TRUE, ix=(-nx):nx, iy=(-ny):ny, ixy=expand.grid(ix=ix,iy=iy)) ## S3 method for class 'psp' periodify(X, nx = 1, ny = 1, ..., combine=TRUE, warn=TRUE, check=TRUE, ix=(-nx):nx, iy=(-ny):ny, ixy=expand.grid(ix=ix,iy=iy)) ## S3 method for class 'owin' periodify(X, nx = 1, ny = 1, ..., combine=TRUE, warn=TRUE, ix=(-nx):nx, iy=(-ny):ny, ixy=expand.grid(ix=ix,iy=iy))
X |
An object representing a spatial pattern (point pattern, line segment pattern or window). |
nx,ny |
Integers.
Numbers of additional copies of |
... |
Ignored. |
combine |
Logical flag determining whether the copies should be superimposed
to make an object like |
warn |
Logical flag determining whether to issue warnings. |
check |
Logical flag determining whether to check the validity of the combined pattern. |
ix, iy |
Integer vectors determining the grid positions of the copies
of |
ixy |
Matrix or data frame with two columns, giving the
grid positions of the copies of |
Given a spatial pattern (point pattern, line segment pattern, etc)
this function makes a number of shifted copies of the pattern
and optionally combines them. The function periodify
is
generic, with methods for various kinds of spatial objects.
The default is to make a 3 by 3 array of copies of X
and
combine them into a single pattern of the same kind as X
.
This can be used (for example) to compute toroidal or periodic
edge corrections for various operations on X
.
If the arguments nx
, ny
are given
and other arguments are missing,
the original object will be copied nx
times to the right
and nx
times to the left, then ny
times upward and
ny
times downward, making (2 * nx + 1) * (2 * ny + 1)
copies altogether, arranged in a grid, centred on the original object.
If the arguments ix
, iy
or ixy
are specified,
then these determine the grid positions of the copies of X
that will be made. For example (ix,iy) = (1, 2)
means a
copy of X
shifted by the vector (ix * w, iy * h)
where
w,h
are the width and height of the bounding rectangle of X
.
If combine=TRUE
(the default) the copies of X
are
superimposed to create an object of the same kind as X
.
If combine=FALSE
the copies of X
are returned as a list.
If combine=TRUE
, an object of the same class as X
.
If combine=FALSE
, a list of objects of the same class as X
.
Adrian Baddeley Adrian.Baddeley@curtin.edu.au
and Rolf Turner r.turner@auckland.ac.nz
data(cells) plot(periodify(cells)) a <- lapply(periodify(Window(cells), combine=FALSE), plot, add=TRUE,lty=2)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.