animBathy: Generate Animated Plot

View source: R/animBathy.R

animBathyR Documentation

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
)

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

Value

an animated ggplot object

Author(s)

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

Examples


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


rLakeHabitat documentation built on April 16, 2025, 1:10 a.m.