| linim.apply | R Documentation |
Returns a pixel image obtained by applying a given function to corresponding pixels in a list of several pixel images on a linear network.
linim.apply(X, FUN, ..., fun.handles.na=FALSE, check=TRUE, verbose=TRUE)
X |
A list of pixel images on the same network
(objects of class |
FUN |
A function that can be applied to vectors, or a character string giving the name of such a function. |
... |
Additional arguments to |
fun.handles.na |
Logical value specifying what to do when the data include
|
check |
Logical value specifying whether to check that the images in
|
verbose |
Logical value specifying whether to print informative messages. |
The argument X should be a list of pixel images on a network
(objects of class "linim"). They should all be defined
on the same network. If the images do not have
identical pixel grids, they will be converted to a common
grid using harmonise.linim.
At each pixel location, the values of the images in X
at that pixel will be extracted as a vector; the function
FUN will be applied to this vector; and the return value of
FUN will become the pixel value of the resulting image.
For example linim.apply(X, mean) will return a pixel image
in which the value of each pixel is the average of the corresponding
pixel values in the images in X.
If the result of FUN is a vector, then the result of
linim.apply will be a list of images.
For example linim.apply(X, range) will
return a list of two images containing the pixelwise minimum
and pixelwise maximum, respectively, of the input images in X.
The argument fun.handles.na specifies what to do
when some of the pixel values are NA.
If fun.handles.na=FALSE (the default),
the function FUN is never applied to data that include
NA values; the result is defined to be NA whenever
the data contain NA.
If fun.handles.na=TRUE, the function FUN will be applied to
all pixel data, including those which contain NA values.
A pixel image on a network (object of class "linim")
or a list of pixel images on the same network.
.
eval.linim for algebraic operations with images.
# list of two pixel images
X <- runiflpp(5, simplenet, nsim=2)
Y <- solapply(lapply(X, distfun), as.linim)
plot(Y)
linim.apply(Y, max)
linim.apply(Y, sum)
linim.apply(Y, range)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.