Learn R Programming

rLakeHabitat (version 1.0.0)

bathyMap: 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
)

Value

ggplot object

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

Author

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

Examples

Run this code
#load raster
DEM <- terra::rast(system.file("extdata", "example_raster.tif", package = 'rLakeHabitat'))
#run function
bathyMap(DEM, contours = TRUE, units = 'm', labels = TRUE)

Run the code above in your browser using DataLab