This operation randomly shifts the locations of the points
in a point pattern. The function rshift
is generic. This function rshift.ppp
is the method for point patterns.
The most common use of this function is to shift the
points in a multitype point pattern.
By default, points of the same type are shifted in parallel
(i.e. points of a common type are shifted by a common displacement vector),
and independently of other types.
This is useful for testing the hypothesis of independence of types
(the null hypothesis that the sub-patterns of points of each type
are independent point processes).
In general the points of X
are divided into groups,
then the points within a group are shifted by a common
random displacement vector. Different groups of points are shifted
independently. The grouping is determined as follows:
-
If the argument
group
is present, then this determines the grouping.
-
Otherwise, if
X
is a multitype point pattern,
the marks determine the grouping.
-
Otherwise, all points belong to a single group.
The argument group
should be a factor, of length equal to the
number of points in X
. Alternatively group
may be NULL
,
which specifies that all points of X
belong to a single group.
By default, every group of points will be shifted.
The argument which
indicates that only some of the groups
should be shifted, while other groups should be left unchanged.
which
must be a vector of levels of group
(for example, a vector of types in a multitype pattern)
indicating which groups are to be shifted.
The displacement vector, i.e. the vector
by which the data points are shifted,
is generated at random.
Parameters that control the randomisation
and the handling of edge effects are passed through
the ...
argument. They are
If the window is a rectangle, the default behaviour is
to generate a displacement vector at random with equal probability
for all possible displacements. This means that the $x$ and
$y$ coordinates of the displacement vector are independent random
variables, uniformly distributed over the range of possible coordinates.
Alternatively, the displacement vector can be generated by
another random mechanism, controlled by the arguments
radius
, width
and height
.
The argument edge
controls what happens when
a shifted point lies outside the window of X
.
Options are:
The optional argument clip
specifies a smaller window
to which the pattern should be restricted.