Given an array data with 4 dimensions,
a subset around the element with coordinates mp ("missing position") is extracted.
The size of the subset in all four directions
from mp is specified by size. ArrayAroundRandom returns a subset around a
random location in data.
Integer vector of length 4
indexing an element in data.
size
Integer vector of length 4, that provides
the size of the subset in all four dimensions
(around mp).
target
One of
c("all", "missing", "observed").
Indicates from which subset of data a random
location is sampled.
verbose
Logical vector of length 1.
If TRUE, messages are printed.
Value
Array with 4 dimensions corresponding to the specified subset.
The attribute mp of the returned array is an integer vector
of length 4 giving mp relative to the
returned array.
Note
When size = c(0, 0, 0, 0), the returned subset consists of one value
(the value of data indexed with mp.)
When mp is near the boundaries of data,
the returned subset may be smaller than indicated by the argument size
and the attribute mp may indicate an element near the boundaries of the subset.