View source: R/tanaka_contour.R
tanaka_contour | R Documentation |
Create a contour layer.
tanaka_contour(x, nclass = 8, breaks, mask)
x |
a raster object. |
nclass |
a number of class. |
breaks |
a vector of break values. |
mask |
a mask layer, a POLYGON or MULTIPOLYGON sf object. |
A MULTIPOLYGON sf object is return. The data.frame contains 3 fields: id, min (minimum value of the raster in the MULTIPOLYGON) and max (maximum value of the raster in the MULTIPOLYGON).
library(tanaka)
library(terra)
library(sf)
ras <- rast(system.file("tif/elev.tif", package = "tanaka"))
iso <- tanaka_contour(x = ras)
plot(st_geometry(iso), col = c(
"#FBDEE1", "#F0BFC3", "#E7A1A6",
"#DD8287", "#D05A60", "#C03239",
"#721B20", "#1D0809"
))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.