tanaka_contour: Create a Contour Layer

View source: R/tanaka_contour.R

tanaka_contourR Documentation

Create a Contour Layer

Description

Create a contour layer.

Usage

tanaka_contour(x, nclass = 8, breaks, mask)

Arguments

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.

Value

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).

Examples

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"
))

tanaka documentation built on July 4, 2022, 5:08 p.m.