Function to reclassify flood durations to potential natural vegetation
Source:R/classifyToPNV.R
classifyToPNV.Rd
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
.
Arguments
- x
argument of type
SpatRaster
.- rcl
optional argument of type
data.frame
with columns and column types as specified indf.pnv
.- filename
supplies an optional output filename of type
character
.- ...
additional arguments as for
writeRaster
.
Value
SpatRaster
object containing potential natural
vegetation distribution as categorical raster.
Examples
# \donttest{
# 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)
}
# }