
Last chance! 50% off unlimited learning
Sale ends in
## S3 method for class 'ppp':
rshift(X, \dots, radius, width, height, edge="torus", clip,
group, which)
"ppp"
"torus"
, "erode"
and "none"
.
See Details.X
,
or NULL
indicating that all points belong to the same group.
Each group will be shifted together, and
separately from other groups.
By default, points in group
."ppp"
). 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:
group
is present, then this determines the grouping.X
is a multitype point pattern,
the marks determine the grouping.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. 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
.
[object Object],[object Object]
The argument edge
controls what happens when
a shifted point lies outside the window of X
.
Options are:
[object Object],[object Object],[object Object]
The optional argument clip
specifies a smaller window
to which the pattern should be restricted.
rshift
,
rshift.psp
data(amacrine)
# random toroidal shift
# shift "on" and "off" points separately
X <- rshift(amacrine)
# shift "on" points and leave "off" points fixed
X <- rshift(amacrine, which="on")
# shift all points simultaneously
X <- rshift(amacrine, group=NULL)
# maximum displacement distance 0.1 units
X <- rshift(amacrine, radius=0.1)
# shift with erosion
X <- rshift(amacrine, radius=0.1, edge="erode")
Run the code above in your browser using DataLab