| crop_burn | R Documentation |
Filters and clips the sparse tables (runs, edges, lines, points)
to a sub-window defined by a target extent. Returns a new
controlledburn object with offset row/col indices and snapped
extent. No dense allocation — just data frame filtering.
crop_burn(x, target)
x |
A |
target |
numeric vector |
A controlledburn object covering only the target window,
with row/col indices re-based to 1.
if (requireNamespace("geos", quietly = TRUE)) {
library(geos)
poly <- as_geos_geometry("POLYGON ((1 1, 9 1, 9 9, 1 9, 1 1))")
r <- burn(poly, extent = c(0, 10, 0, 10), dimension = c(100L, 100L))
sub <- crop_burn(r, target = c(2, 5, 3, 7))
sub
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.