bathyMap: Plot Bathymetry Map

View source: R/bathyMap.R

bathyMapR Documentation

Plot Bathymetry Map

Description

Generate a bathymetry map from a provided DEM raster with optional contours and depth labels.

Usage

bathyMap(
  DEM,
  contours = TRUE,
  start = NULL,
  end = NULL,
  by = 5,
  breaks = NULL,
  units = "ft",
  labels = TRUE,
  textSize = 1.5,
  plotTitle = NULL
)

Arguments

DEM

SpatRaster object of a given waterbody, rasters can be transformed to SpatRaster via the rast() function in 'terra'

contours

logical indicating whether contours should included (TRUE) or not (FALSE), default = TRUE

start

numeric value describing what value contours should start at, default = 0

end

numeric value describing what value contours should end at, default = max depth

by

numeric value describing contour intervals, default = 5

breaks

optional numeric vector describing specific contours to include if contours = T, default = NULL

units

character describing units of depth measurement, default = "ft"

labels

logical indicating whether labels should be included (TRUE) or not (FALSE), default = TRUE

textSize

number describing text size of contour labels if included, default = 1.5

plotTitle

optional character string adding title to output plot

Value

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
bathyMap(DEM, contours = TRUE, units = 'm', labels = TRUE)

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