View source: R/classifyToPNV.R
classifyToPNV | R Documentation |
This function is a wrapper to the function
classify
to convert flood durations computed with
flood3
into potential natural vegetation (PNV) distributions using
reclassification rules supplied with df.pnv
. Alternative
reclassification rules may be applied, but they must match column names and
types as given by df.pnv
. classify
is
called with include.lowest = TRUE
and right = FALSE
.
classifyToPNV(x, rcl = NULL, filename = "", ...)
x |
argument of type |
rcl |
optional argument of type |
filename |
supplies an optional output filename of type
|
... |
additional arguments as for |
SpatRaster
object containing potential natural
vegetation distribution as categorical raster.
ochs_potential_2020hydflood
df.pnv
# deactivated, since it's very time-consuming
if (FALSE) {
cache <- tempdir()
options("hyd1d.datadir" = cache)
options("hydflood.datadir" = cache)
options("timeout" = 200)
library(hydflood)
# import the raster data and create a raster stack
c <- st_crs("EPSG:25833")
e <- ext(309000, 310000, 5749000, 5750000)
x <- hydSpatRaster(ext = e, crs = c)
# create a temporal sequence
seq <- seq(as.Date("2016-01-01"), as.Date("2016-12-31"), by = "day")
# compute a flood duration
fd <- flood3(x = x, seq = seq)
# reclassify to PNV
pnv <- classifyToPNV(fd)
# plot pnv map
plot(pnv)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.