animBathy | R Documentation |
Generate an animated plot of littoral area at different water level increments from a raster digital elevation model (DEM).
animBathy(
DEM,
units = "ft",
littoral = TRUE,
secchi = NULL,
photic = NULL,
stop = NULL,
by = 1
)
DEM |
SpatRaster object of a given waterbody, rasters can be transformed to SpatRaster via the rast() function in 'terra' |
units |
character describing depth units of DEM. Can be meters ("m") or feet ("ft"). Default = "ft" |
littoral |
logical indicating if littoral zone should be plotted (T) or entire waterbody (F), default = TRUE |
secchi |
number giving the average Secchi depth of the waterbody, photic zone estimated as 2.6m * secchi |
photic |
number giving the average photic depth of the waterbody, overwrites Secchi |
stop |
optional numeric value specifying depth at which to stop animation, default = NULL (all depths) |
by |
numeric value specifying depth increments between plots. Higher values will result in lower resolution. Default = 1 |
an animated ggplot object
Tristan Blechinger, Department of Zoology & Physiology, University of Wyoming
#load raster
DEM <- terra::rast(system.file("extdata", "example_raster.tif", package = 'rLakeHabitat'))
#run function
animBathy(DEM, units = 'm', littoral = TRUE, secchi = 1, by = 5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.