Description Usage Arguments Examples
This function can be useful when applying windowed functions over a raster,
as with glcm
. This function allows windowed functions that have edge
effects to be applied over a raster in block-by-block fashion.
apply_windowed
avoids the striping that would result if the edge
effects were ignored.
1 2 | apply_windowed(x, fun, edge = c(0, 0), chunksize = NULL, filename = "",
overwrite = FALSE, datatype = "FLT4S", ...)
|
x |
a |
fun |
the function to apply |
edge |
length 2 numeric with number of rows on top and bottom with edge effects, defined as c(top, bottom) |
chunksize |
the number of rows to read per block (passed to
|
filename |
file on disk to save |
overwrite |
whether to overwrite any existing files (otherwise an error will be raised) |
datatype |
the |
... |
additional arguments to pass to |
1 2 3 4 5 6 7 | ## Not run:
L5TSR_1986_b1 <- raster(L5TSR_1986, layer=1)
min_x <- cellStats(L5TSR_1986_b1, 'min')
max_x <- cellStats(L5TSR_1986_b1, 'max')
apply_windowed(L5TSR_1986_b1, glcm, edge=c(1, 3), min_x=min_x, max_x=max_x)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.