View source: R/functions_raster.R
isoline_from_raster | R Documentation |
Polygon around gridcells with a value larger than or equal to the specified threshold
isoline_from_raster(grid, alpha)
grid |
A two-dimensional
|
alpha |
A numeric value. Threshold value. |
A sf
polygon
r <- stars::st_as_stars(
data.frame(
x = rep(1:10, times = 10),
y = rep(10:1, each = 10),
value = 1:100
),
dims = c("x", "y")
)
ip1 <- isoline_from_raster(r, alpha = 45)
ip2 <- isoline_from_raster(r, alpha = 87)
if (requireNamespace("grDevices")) {
plot(r, reset = FALSE)
plot(ip1, col = NA, border = "black", add = TRUE)
plot(ip2, col = NA, border = "blue", add = TRUE)
grDevices::dev.off()
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.