Description Usage Arguments Details Value
View source: R/Spatial_Functions.R
This is similar to aggregate
but with more control
and information.
1 2 3 4 5 6 7 8 | reaggregate_raster(
x,
coords,
to_res = c(0, 0),
with_weights = NULL,
method = c("raster", "raster_con", "block"),
tol = 0.01
)
|
x |
A |
coords |
A numeric vector of length two or a matrix with two columns. The x and y coordinates of the center(s) of the rectangle(s). |
to_res |
A numeric vector of length two. The x- and y-extent of the rectangle(s). |
with_weights |
A logical value or |
method |
A character string. Selects the extraction method, see details. |
tol |
A numeric value. The absolute tolerance for deviation used if
|
Available extraction method
s include
Uses the function extract
Uses the function
extract2_Raster_SpatialPolygons
. This is a modified version
of extract
where the 'connection' to the raster
file is open for the entire extraction call and not re-opened/closed
for each read event. This allows a massive speed-up which scales with
the number of 'rectangles' to be extracted [not implemented].
Uses the function extract_blocks
.
The weighted mean of the extracted values can be calculated as stats::weighted.mean(values, w = weights)
A list of length corresponding to the number of rectangles. Each element is a list which contains three items each
An integer vector. The number of unique values within the
rectangle for each layer of x
.
A list of numeric vectors. The sorted unique values as vector for each layer.
A list of numeric vectors. The weights of the
values
for each layer.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.