| Title: | Interpolate Bathymetry and Quantify Physical Aquatic Habitat |
|---|---|
| Description: | Offers bathymetric interpolation using Inverse Distance Weighted and Ordinary Kriging via the 'gstat' and 'terra' packages. Other functions focus on quantifying physical aquatic habitats (e.g., littoral, epliminion, metalimnion, hypolimnion) from interpolated digital elevation models (DEMs). Functions were designed to calculate these metrics across water levels for use in reservoirs but can be applied to any DEM and will provide values for fixed conditions. Parameters like Secchi disk depth or estimated photic zone, thermocline depth, and water level fluctuation depth are included in most functions. |
| Authors: | Tristan Blechinger [aut, cre] (ORCID: <https://orcid.org/0009-0005-6730-8856>), Sean Bertalot [aut] (ORCID: <https://orcid.org/0000-0001-8099-0144>) |
| Maintainer: | Tristan Blechinger <[email protected]> |
| License: | GPL (>= 3) |
| Version: | 1.0.2 |
| Built: | 2026-05-26 06:24:48 UTC |
| Source: | https://gitlab.com/tristanblechinger/rlakehabitat |
Generate an animated plot of littoral area at different water level increments from a raster digital elevation model (DEM).
animBathy( DEM, units = "m", littoral = TRUE, secchi = NULL, photic = NULL, stop = NULL, by = 1 )animBathy( DEM, units = "m", 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.5m * 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 |
We recommend using the calcPhotic function to estimate photic depth instead of using a Secchi disk measurement
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)#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)
Generate a bathymetry map from a provided DEM raster with optional contours and depth labels.
bathyMap( DEM, contours = TRUE, start = NULL, end = NULL, by = 5, breaks = NULL, units = "m", labels = TRUE, textSize = 1.5, plotTitle = NULL )bathyMap( DEM, contours = TRUE, start = NULL, end = NULL, by = 5, breaks = NULL, units = "m", labels = TRUE, textSize = 1.5, plotTitle = NULL )
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 |
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 bathyMap(DEM, contours = TRUE, units = 'm', labels = TRUE)#load raster DEM <- terra::rast(system.file("extdata", "example_raster.tif", package = 'rLakeHabitat')) #run function bathyMap(DEM, contours = TRUE, units = 'm', labels = TRUE)
Calculates area at each depth for a given waterbody.
calcHyps(DEM, DEMunits = "m", depthUnits = "m", by = 1, output = "values")calcHyps(DEM, DEMunits = "m", depthUnits = "m", by = 1, output = "values")
DEM |
SpatRaster object of a given waterbody, rasters can be transformed to SpatRaster via the rast() function in 'terra' |
DEMunits |
character describing units of raster coordinate system. Can be meters, kilometers, or hectares ("m", "km", "ha"), default = "m" |
depthUnits |
character describing units of depth measurement. Can be either feet or meters ("ft", "m"), default = "ft" |
by |
numeric increment per unit by which volumes are calculated. Higher values will result in lower resolution. Default = 1 |
output |
character describing desired output, can either be a data frame of values ("values") or a hypsography plot ("plot"). Default = "values" |
data frame of areas at each depth unit ("values") or a hypsography plot ("plot")
Tristan Blechinger, Department of Zoology & Physiology, University of Wyoming
#load raster DEM <- terra::rast(system.file("extdata", "example_raster.tif", package = 'rLakeHabitat')) #run function calcHyps(DEM, DEMunits = 'm', depthUnits = 'm', by = 1, output = 'values')#load raster DEM <- terra::rast(system.file("extdata", "example_raster.tif", package = 'rLakeHabitat')) #run function calcHyps(DEM, DEMunits = 'm', depthUnits = 'm', by = 1, output = 'values')
Calculates littoral surface area (2D) of a given waterbody across water levels based on an average photic depth value.
calcLittoral( DEM, photic = NULL, secchi = NULL, DEMunits = "m", depthUnits = "m", by = 1, stop = NULL )calcLittoral( DEM, photic = NULL, secchi = NULL, DEMunits = "m", depthUnits = "m", by = 1, stop = NULL )
DEM |
SpatRaster object of a given waterbody, rasters can be transformed to SpatRaster via the rast() function in 'terra' |
photic |
number giving the average photic depth, overwrites Secchi depth |
secchi |
number giving the average secchi depth, photic zone estimated as 2.5m * secchi |
DEMunits |
character describing units of raster coordinate system. Can be meters, kilometers, or hectares ("m", "km", "ha"), default = "m" |
depthUnits |
character describing units of depth measurement (secchi and DEM). Can be either feet or meters ("ft", "m"), default = "ft" |
by |
numeric increment per unit depth by which areas are calculated. Higher values will result in lower resolution. Default = 1 |
stop |
optional numeric value specifying depth at which to stop calculations, default = NULL |
We recommend using the calcPhotic function to estimate photic depth instead of using a Secchi disk measurement
data frame of areas in specified units for each depth, as well as the littoral percentage of total surface area
Tristan Blechinger, Department of Zoology & Physiology, University of Wyoming
#load raster DEM <- terra::rast(system.file("extdata", "example_raster.tif", package = 'rLakeHabitat')) #run function calcLittoral(DEM, secchi = 1, depthUnits = "m", DEMunits = "m")#load raster DEM <- terra::rast(system.file("extdata", "example_raster.tif", package = 'rLakeHabitat')) #run function calcLittoral(DEM, secchi = 1, depthUnits = "m", DEMunits = "m")
Calculates euphotic depth from a Secchi disk measuremnt (meters) based on relationships between light attenuation (Kd), optical properties of water (F), and a measured Secchi depth (Zsd). Based on equations specified by Kirk (1994) and Koenings and Edmundson (1991).
calcPhotic(Z, F = 1.99)calcPhotic(Z, F = 1.99)
Z |
numeric value for measured Secchi disk depth in meters |
F |
numerical constant that accounts for optical properties of water, default = 1.99 |
Kirk, J. T. O. (1994). Light and Photosynthesis in Aquatic Ecosystems. Cambridge University Press. Koenings, J. P., & Edmundson, J. A. (1991). Secchi disk and photometer estimates of light regimes in Alaskan lakes: Effects of yellow color and turbidity. Limnology and Oceanography, 36(1), 91–105. https://doi.org/10.4319/lo.1991.36.1.0091
We recommend finding a value from the literature that most accurately reflects the water quality of the study system, but values for generalized conditions are included from Koenings and Edmundson (1991). F = 2.76 for stained lakes F = 1.99 for clear lakes F = 1.05 for turbid lakes
Tristan Blechinger, Department of Zoology & Physiology, University of Wyoming
calcPhotic(Z = 4, F = 1.99)calcPhotic(Z = 4, F = 1.99)
Calculates Shoreline Development Index value across water levels for a given waterbody.
calcSDI(DEM, units = "m", by = 1, stop = NULL)calcSDI(DEM, units = "m", by = 1, stop = NULL)
DEM |
SpatRaster object of a given waterbody, rasters can be transformed to SpatRaster via the rast() function in 'terra' |
units |
character describing units of raster coordinate system. Can be meters, kilometers, or hectares ("m", "km", "ha"), default = "m" |
by |
numeric increment per unit depth by which areas are calculated. Higher values will result in lower resolution. Default = 1 |
stop |
optional numeric value specifying depth at which to stop calculations, default = NULL |
data frame of perimeter lengths and SDI values for given depths
Tristan Blechinger, Department of Zoology & Physiology, University of Wyoming
#load raster DEM <- terra::rast(system.file("extdata", "example_raster.tif", package = 'rLakeHabitat')) #run function calcSDI(DEM, units = 'm')#load raster DEM <- terra::rast(system.file("extdata", "example_raster.tif", package = 'rLakeHabitat')) #run function calcSDI(DEM, units = 'm')
Calculates epilimnion, metalimnion, and hypolimnion volumes based on defined thermocline depths across water levels.
calcVolume( DEM, thermo_depth = NULL, thermo_high, thermo_low, DEMunits = "m", depthUnits = "m", by = 1, stop = NULL )calcVolume( DEM, thermo_depth = NULL, thermo_high, thermo_low, DEMunits = "m", depthUnits = "m", by = 1, stop = NULL )
DEM |
SpatRaster object of a given waterbody, rasters can be transformed to SpatRaster via the rast() function in 'terra' |
thermo_depth |
number giving the estimated middle of thermocline, results in calculation of only epilimnion and hypolimnion volumes. Default = NULL, cannot use in conjunction with thermo_low and thermo_high |
thermo_high |
number giving the upper bound of thermocline depth, results in calculation of epilimnion, metalimnion, and hypolimnion values |
thermo_low |
number giving the lower bound of thermocline depth, results in calculation of epilimnion, metalimnion, and hypolimnion values |
DEMunits |
character describing units of raster coordinate system. Can be meters, kilometers, or hectares ("m", "km", "ha"), default = "m" |
depthUnits |
character describing units of depth measurement. Can be either feet or meters ("ft", "m"), default = "ft" |
by |
numeric increment per unit by which volumes are calculated. Higher values will result in lower resolution. Default = 1 |
stop |
optional numeric value specifying depth at which to stop habitat volume calculations, default = NULL |
a data frame of volumes in cubic meters calculated for each habitat (epilimnion, metalimnion, hypolimnion)
Tristan Blechinger, Department of Zoology & Physiology, University of Wyoming
#load raster DEM <- terra::rast(system.file("extdata", "example_raster.tif", package = 'rLakeHabitat')) #run function calcVolume(DEM, thermo_depth = 3, DEMunits = 'm', depthUnits = 'm')#load raster DEM <- terra::rast(system.file("extdata", "example_raster.tif", package = 'rLakeHabitat')) #run function calcVolume(DEM, thermo_depth = 3, DEMunits = 'm', depthUnits = 'm')
Get point coordinates and depth values along predetermined contours at a specified density.
contourPoints(object, depths = NULL, geometry = "geometry", density = 10)contourPoints(object, depths = NULL, geometry = "geometry", density = 10)
object |
polygon or multipolygon shapefile (.shp) with depths included as an attribute column. Can be an sf or spatVector object. |
depths |
character string describing column name of depth attribute |
geometry |
character string describing column name of geometries. Default = "geometry" |
density |
numeric value describing distance between points in meters, default = 10m |
dataframe of coordinates and associated depths
Tristan Blechinger, Department of Zoology & Physiology, University of Wyoming
# load test data data <- sf::read_sf(system.file("extdata", "example_contour.shp", package = 'rLakeHabitat')) #run function contourPoints(data, depths = "Z", geometry = "geometry", density = 50)# load test data data <- sf::read_sf(system.file("extdata", "example_contour.shp", package = 'rLakeHabitat')) #run function contourPoints(data, depths = "Z", geometry = "geometry", density = 50)
Obtain residual mean square error (RMSE) from K-fold cross validation of bathymetry interpolation.
crossValidate( outline, df, x, y, z, zeros = FALSE, separation = NULL, k = 5, crsUnits = "dd", res = 5, method = "IDW", fact = NULL, nmax = 20, idp = 2, model = "Sph", psill = NULL, range = NULL, nugget = 0, kappa = NULL )crossValidate( outline, df, x, y, z, zeros = FALSE, separation = NULL, k = 5, crsUnits = "dd", res = 5, method = "IDW", fact = NULL, nmax = 20, idp = 2, model = "Sph", psill = NULL, range = NULL, nugget = 0, kappa = NULL )
outline |
shapefile outline of a waterbody |
df |
dataframe of coordinates and depths for a given waterbody |
x |
character giving name of longitude column |
y |
character giving name of latitude column |
z |
character giving name of depth column |
zeros |
logical describing if bounding zeros are needed (FALSE) or provided (TRUE), default = FALSE |
separation |
number describing distance between points, units from CRS |
k |
numeric value describing the number of folds to test, default = 5 |
crsUnits |
character describing CRS units of input outline, either "dd" (decimal degrees) or "m" (meters), default = "dd" |
res |
number describing desired cell resolution in meters, default = 5 |
method |
character describing method of interpolation, options include Inverse Distance Weighted ("IDW") or Ordinary Kriging ("OK"). Default = "IDW" |
fact |
numeric value describing the factor by which raster resolution should be increased, default = NULL. If 'crsUnits' and 'res' are defined, fact = NULL |
nmax |
numeric value describing number of neighbors used in interpolation, default = 20 |
idp |
numeric value describing inverse distance power value for IDW interpolation |
model |
character describing type of model used in Ordinary Kriging, options include 'Sph', 'Exp', 'Gau', 'Sta', default = 'Sph' |
psill |
numeric value describing the partial sill value for OK interpolation, default = NULL |
range |
numeric describing distance beyond which there is no spatial correlation in Ordinary Kriging models, default = NULL |
nugget |
numeric describing variance at zero distance in Ordinary Kriging models, default = 0 |
kappa |
numeric value describing model smoothness, default = NULL |
If both 'crsUnit' and 'res' = NULL, the output raster will be in the same CRS and units as the input 'outline' and the resolution will be increased by 'fact' (default = 10). If both 'crsUnit' and 'res' are defined, fact = NULL and the output raster will be projected to the most appropriate UTM zone at the specified resolution.
For the model argument there are four different methods included here that are supported by gstat::vgm ("Sph", "Exp", "Gau", "Mat"). "Sph" = The default gstat::vgm method. Spherical model characterized by a curve that rises steeply to defined range then flattens, indicates no spatial correlation between points beyond that range. "Exp" = Exponential model characterized by spatial correlation decaying with distance. "Gau" = Gaussian model similar to spatial model but with stronger decay at shorter distances. "Mat" = Matern model Three parameters (psill, range, kappa) are incorporated from a fitted variogram (default = NULL). If specified in function input, chosen values will overwrite variogram values.
mean RMSE value across k number of folds
Tristan Blechinger, Department of Zoology & Physiology, University of Wyoming
#load example outline outline <- terra::vect(system.file("extdata", "example_outline.shp", package = 'rLakeHabitat')) #load example xyz data data <- read.csv(system.file("extdata", "example_depths.csv", package = 'rLakeHabitat')) #run function crossValidate(outline, data, "x", "y", "z", zeros = FALSE, separation = 10, k = 5, crsUnit = "dd", res = 50, method = "IDW", nmax = 4, idp = 1.5)#load example outline outline <- terra::vect(system.file("extdata", "example_outline.shp", package = 'rLakeHabitat')) #load example xyz data data <- read.csv(system.file("extdata", "example_depths.csv", package = 'rLakeHabitat')) #run function crossValidate(outline, data, "x", "y", "z", zeros = FALSE, separation = 10, k = 5, crsUnit = "dd", res = 50, method = "IDW", nmax = 4, idp = 1.5)
Estimate average thermocline depth across multiple sites and dates.
estThermo(data, site, date, depth, temp, combine = "all")estThermo(data, site, date, depth, temp, combine = "all")
data |
data frame of water column temperature profiles |
site |
character giving the name of the site column |
date |
character giving the name of the date column |
depth |
character giving the name of the depth column |
temp |
character giving the name of the temp column |
combine |
logical indicating whether or not to average across sites ("sites"), dates ("dates"), or sites and dates ("all"), default = "all" |
either numeric value of average thermocline depth, standard deviation, and n or data frame of thermocline depths, standard deviations, and n across sites or dates
Tristan Blechinger, Department of Zoology & Physiology, University of Wyoming
# load test profile data data <- read.csv(system.file("extdata", "example_profile_data.csv", package = 'rLakeHabitat')) data$date <- base::as.Date(data$date) #run function estThermo(data = data, site = "site", date = "date", depth = "depth", temp = "temp", combine = "all")# load test profile data data <- read.csv(system.file("extdata", "example_profile_data.csv", package = 'rLakeHabitat')) data$date <- base::as.Date(data$date) #run function estThermo(data = data, site = "site", date = "date", depth = "depth", temp = "temp", combine = "all")
Create a raster stack from a single raster, option to save as file.
genStack( DEM, by = 1, stop = NULL, save = TRUE, file_name = NULL, file_type = "COG" )genStack( DEM, by = 1, stop = NULL, save = TRUE, file_name = NULL, file_type = "COG" )
DEM |
raster object |
by |
numeric increment per unit depth by which layers are split. Default = 1 |
stop |
optional numeric value specifying depth at which to stop stacking rasters, default = NULL |
save |
logical, save raster stack (TRUE) or not (FALSE), default = TRUE |
file_name |
character string used to name saved raster stack |
file_type |
character string defining file type to save, default = "COG" |
a raster stack of specified depth increments for a given waterbody. Raster stack is either stored as an object (save = FALSE) or written to a file in the directory (save = TRUE).
Tristan Blechinger, Department of Zoology & Physiology, University of Wyoming
#load raster DEM <- terra::rast(system.file("extdata", "example_raster.tif", package = 'rLakeHabitat')) #run function genStack(DEM, by = 1, save = FALSE)#load raster DEM <- terra::rast(system.file("extdata", "example_raster.tif", package = 'rLakeHabitat')) #run function genStack(DEM, by = 1, save = FALSE)
Generate a bathymetric digital elevation model (DEM) for a given waterbody using either Inverse Distance Weighting or Ordinary Kriging interpolation. For high densities of point data, we recommend rarifying prior to interpolation to improve accuracy and reduce computation time (see rarify function).
interpBathy( outline, df, x, y, z, zeros = FALSE, separation = NULL, crsUnits = "dd", res = 10, method = "IDW", fact = NULL, nmax = 20, idp = 2, model = "Sph", psill = NULL, range = NULL, nugget = 0, kappa = NULL )interpBathy( outline, df, x, y, z, zeros = FALSE, separation = NULL, crsUnits = "dd", res = 10, method = "IDW", fact = NULL, nmax = 20, idp = 2, model = "Sph", psill = NULL, range = NULL, nugget = 0, kappa = NULL )
outline |
shapefile outline of a waterbody |
df |
dataframe of coordinates and depths for a given waterbody |
x |
character giving name of longitude column |
y |
character giving name of latitude column |
z |
character giving name of depth column |
zeros |
logical describing if bounding zeros are needed (FALSE) or provided (TRUE), default = FALSE |
separation |
number describing distance between points, units from CRS |
crsUnits |
character describing CRS units of input outline, either "dd" (decimal degrees) or "m" (meters), default = "dd" |
res |
number describing desired cell resolution in meters, default = 10 |
method |
character describing method of interpolation, options include Inverse Distance Weighted ("IDW") or Ordinary Kriging ("OK"). Default = "IDW" |
fact |
numeric value describing the factor by which raster resolution should be increased, default = NULL If 'crsUnits' and 'res' are defined, fact = NULL |
nmax |
numeric value describing number of neighbors used in interpolation, default = 20 |
idp |
numeric value describing inverse distance power value for IDW interpolation |
model |
character describing type of model used in Ordinary Kriging, options include 'Sph', 'Exp', 'Gau', 'Sta', default = 'Sph' |
psill |
numeric value describing the partial sill value for OK interpolation, default = NULL |
range |
numeric describing distance beyond which there is no spatial correlation in Ordinary Kriging models, default = NULL |
nugget |
numeric describing variance at zero distance in Ordinary Kriging models, default = 0 |
kappa |
numeric value describing model smoothness, default = NULL |
If 'res' and 'crsUnits' are specified (recommended), the output raster is returned in the original projection at the specified resolution. If 'res' and 'crsUnits' are not specified, 'fact' must be defined as a numeric value by which the resolution of the output DEM will be increased (1 = no change). Output raster will be returned in the original projection of the input.
For the model argument there are four different methods included here that are supported by gstat::vgm ("Sph", "Exp", "Gau", "Mat"). "Sph" = The default gstat::vgm method. Spherical model characterized by a curve that rises steeply to defined range then flattens, indicates no spatial correlation between points beyond that range. "Exp" = Exponential model characterized by spatial correlation decaying with distance. "Gau" = Gaussian model similar to spatial model but with stronger decay at shorter distances. "Mat" = Matern model Three parameters (psill, range, kappa) are incorporated from a fitted variogram (default = NULL). If specified in function input, chosen values will overwrite variogram values.
DEMs generated using OK method will have two layers; the first are the interpolated values and the second are the variances associated with each measurement
DEM of waterbody bathymetry
Tristan Blechinger & Sean Bertalot, Department of Zoology & Physiology, University of Wyoming
#load example outline outline <- terra::vect(system.file("extdata", "example_outline.shp", package = 'rLakeHabitat')) #load example xyz data data <- read.csv(system.file("extdata", "example_depths.csv", package = 'rLakeHabitat')) #run function interpBathy(outline, data, "x", "y", "z", zeros = FALSE, separation = 10, crsUnit = "dd", res = 5, method = "IDW", nmax = 4, idp = 2)#load example outline outline <- terra::vect(system.file("extdata", "example_outline.shp", package = 'rLakeHabitat')) #load example xyz data data <- read.csv(system.file("extdata", "example_depths.csv", package = 'rLakeHabitat')) #run function interpBathy(outline, data, "x", "y", "z", zeros = FALSE, separation = 10, crsUnit = "dd", res = 5, method = "IDW", nmax = 4, idp = 2)
Calculate littoral and pelagic volume across water levels from a DEM based on estimated photic depth.
littoralVol( DEM, photic, secchi = NULL, DEMunits = "m", depthUnits = "m", by = 1 )littoralVol( DEM, photic, secchi = NULL, DEMunits = "m", depthUnits = "m", by = 1 )
DEM |
SpatRaster object of a given waterbody, rasters can be transformed to SpatRaster via the rast() function in 'terra' |
photic |
number giving the average photic depth, overwrites Secchi depth |
secchi |
number giving the average secchi depth, photic zone estimated as 2.5m * secchi |
DEMunits |
character describing units of raster coordinate system. Can be meters, kilometers, or hectares ("m", "km", "ha"), default = "m" |
depthUnits |
character describing units of depth measurement. Can be either feet or meters ("ft", "m"), default = "ft" |
by |
numeric increment per unit by which volumes are calculated. Higher values will result in lower resolution. Default = 1 |
We recommend using the calcPhotic function to estimate photic depth instead of using a Secchi disk measurement
data frame of littoral and pelagic volume estimates
Tristan Blechinger, Department of Zoology & Physiology, University of Wyoming
#load raster DEM <- terra::rast(system.file("extdata", "example_raster.tif", package = 'rLakeHabitat')) #run function littoralVol(DEM, photic = 2, DEMunits = "m", depthUnits = "m", by = 1)#load raster DEM <- terra::rast(system.file("extdata", "example_raster.tif", package = 'rLakeHabitat')) #run function littoralVol(DEM, photic = 2, DEMunits = "m", depthUnits = "m", by = 1)
Reduce density of mapped depth data to improve accuracy and computation time.
rarify(outline, df, x, y, z, res = 10, crsUnits = "dd")rarify(outline, df, x, y, z, res = 10, crsUnits = "dd")
outline |
shapefile outline of a waterbody |
df |
dataframe of coordinates and depths for a given waterbody |
x |
character giving name of longitude column |
y |
character giving name of latitude column |
z |
character giving name of depth column |
res |
number describing by how much to increase point resolution, default = 10 |
crsUnits |
character describing CRS units of input outline, either "dd" (decimal degrees) or "m" (meters), default = "dd" |
dataframe of rarified xyz coordinates
Sean Bertalot & Tristan Blechinger, Department of Zoology & Physiology, University of Wyoming
#load test data outline <- terra::vect(system.file("extdata", "example_outline.shp", package = 'rLakeHabitat')) depths <- read.csv(system.file("extdata", "example_depths.csv", package = 'rLakeHabitat')) #run function rarify(outline = outline, df = depths, x = "x", y = "y", z = "z", res = 100, crsUnits = "dd")#load test data outline <- terra::vect(system.file("extdata", "example_outline.shp", package = 'rLakeHabitat')) depths <- read.csv(system.file("extdata", "example_depths.csv", package = 'rLakeHabitat')) #run function rarify(outline = outline, df = depths, x = "x", y = "y", z = "z", res = 100, crsUnits = "dd")