Learn R Programming

rLakeHabitat (version 1.0.0)

animBathy: Generate Animated Plot

Description

Generate an animated plot of littoral area at different water level increments from a raster digital elevation model (DEM).

Usage

animBathy(
  DEM,
  units = "ft",
  littoral = TRUE,
  secchi = NULL,
  photic = NULL,
  stop = NULL,
  by = 1
)

Value

an animated ggplot object

Arguments

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

Author

Tristan Blechinger, Department of Zoology & Physiology, University of Wyoming

Examples

Run this code
# \donttest{
#load raster
DEM <- terra::rast(system.file("extdata", "example_raster.tif", package = 'rLakeHabitat'))
.old_wd <- setwd(tempdir())
#run function
animBathy(DEM, units = 'm', littoral = TRUE, secchi = 1, by = 5)
setwd(.old_wd)# }

Run the code above in your browser using DataLab