Randomly pertubs a spatial pattern of line segments by applying independent random displacements to the segment endpoints.
# S3 method for psp
rjitter(X, radius, …, clip=TRUE, nsim=1, drop=TRUE)
A point pattern on a linear network
(object of class "psp"
).
Scale of perturbations. A positive numerical value. Each point will be displaced by a random distance, with maximum displacement equal to this value.
Ignored.
Logical value specifying what to do if segments cross the boundary of the window. See Details.
Number of simulated realisations to be generated.
Logical. If nsim=1
and drop=TRUE
(the default), the
result will be a spatial pattern of line segments (class
"psp"
) rather than a list of length 1 containing this pattern.
A spatial pattern of line segments
(object of class "psp"
)
or a list of such patterns.
The function rjitter
is generic. This function is
the method for the class "psp"
of line segment patterns.
Each of the endpoints of each segment in X
will be
subjected to an independent random displacement. The displacement vectors are
uniformly distributed in a circle of radius radius
.
If clip=TRUE
(the default), segment endpoints
are permitted to move to locations slightly outside the window of X
,
and the resulting segments will be clipped to the window.
If clip=FALSE
, segment endpoints are conditioned to fall
inside the window.
If nsim=1
and drop=TRUE
, the result is another
spatial pattern of line segments (object of class "psp"
).
Otherwise, the result is a list of nsim
line segment patterns.
rjitter
for point patterns in two dimensions.
# NOT RUN {
E <- edges(letterR)
Window(E) <- owin(c(1.9, 4.1), c(0.5, 3.5))
plot(rjitter(E, 0.1))
# }
Run the code above in your browser using DataLab