Last chance! 50% off unlimited learning
Sale ends in
rlabel(X, labels=marks(X), permute=TRUE)
"ppp"
).labels
or
by drawing a random sample with replacement.X
. It is useful
for hypothesis testing purposes. In the simplest case, the command rlabel(X)
yields
a point pattern obtained from X
by randomly permuting
the marks of the points.
If permute=TRUE
, then labels
should be a vector of
length equal to the number of points in X
.
The result of rlabel
will be a point pattern
with locations given by X
and marks given by
a random permutation of labels
(i.e. a random sample without
replacement).
If permute=FALSE
, then labels
may be a vector of
any length.
The result of rlabel
will be a point pattern
with locations given by X
and marks given by
a random sample from labels
(with replacement).
marks<-
to assign arbitrary marks.data(amacrine)
# Randomly permute the marks "on" and "off"
# Result always has 142 "off" and 152 "on"
Y <- rlabel(amacrine)
# randomly allocate marks "on" and "off"
# with probabilities p(off) = 0.48, p(on) = 0.52
Y <- rlabel(amacrine, permute=FALSE)
# randomly allocate marks "A" and "B" with equal probability
data(cells)
Y <- rlabel(cells, labels=factor(c("A", "B")), permute=FALSE)
Run the code above in your browser using DataLab