xapp | R Documentation |
Apply a function to the values of each cell of two (multilayer) SpatRasters.
## S4 method for signature 'SpatRaster,SpatRaster'
xapp(x, y, fun, ..., filename="", overwrite=FALSE, wopt=list())
x |
SpatRaster |
y |
SpatRaster with the same geometry as |
fun |
a function that operates on two vectors |
... |
additional arguments for |
filename |
character. Output filename |
overwrite |
logical. If |
wopt |
list with named options for writing files as in |
SpatRaster
app
, lapp
, tapp
, Math-methods
, roll
r <- rast(ncols=10, nrows=10, nlyr=5)
set.seed(1)
r <- init(r, runif)
s <- init(r, runif)
x <- xapp(r, s, fun=cor)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.