Description Usage Arguments Value Examples
View source: R/calc_functions.R
Calculates the difference between the maximum and minimum value
1 2 3 4 5 6 7 |
x |
RasterLayer. The data over which to calculate the range size |
... |
further arguments passed to or from other methods |
d |
numeric. If |
type |
character. The shape of the moving window |
na.rm |
logical. indicates whether |
If class(x) == "winmove"
, a smoothed raster with the size of the range of values calculated within the specified
moving window
If class(x) == "numeric"
, a single value representing the size of the range of values in x
1 2 3 4 5 6 7 8 9 10 11 12 13 | # load required data
data(cat_ls)
data(cont_ls)
# convert data to object of class winmove
cat_ls <- new("winmove", cat_ls)
# aggregate using a rectangular window with dimensions c(2,3)
d <- range(cont_ls, d = c(2,3), type = "rectangle")
# convert data to object of class numeric
cont_ls <- raster::values(cont_ls)
d <- range(cont_ls)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.