check_depth: Check which points have potentially invalid depths.

View source: R/check_depth.R

check_depthR Documentation

Check which points have potentially invalid depths.

Description

Check which points have potentially invalid depths.

Usage

check_depth(data, report = FALSE, depthmargin = 0, shoremargin = NA,
  bathymetry = NULL)

Arguments

data

The data frame.

report

If TRUE, errors are returned instead of records.

depthmargin

How much can the given depth deviate from the bathymetry in the rasters (in meters).

shoremargin

How far offshore (in meters) should a record be to have a bathymetry greater than 0. If NA (default) then this test is ignored.

bathymetry

SpatRaster ([terra] package) object that you want to use to check the depth against. If NULL (default) then the bathymetry from the xylookup service is used.

Details

Multiple checks are performed in this function:

  1. missing depth column (warning)

  2. empty depth column (warning)

  3. depth values that can't be converted to numbers (error)

  4. depth values that are larger than the depth value in the bathymetry layer, after applying the provided depthmargin (error)

  5. depth values that are negative for off shore points, after applying the provided shoremargin (error)

  6. minimum depth greater than maximum depth (error)

Value

Problematic records or an errors report.

See Also

check_onland check_outliers_dataset check_outliers_species lookup_xy

Examples

## Not run: 
notok <- check_depth(abra, report = FALSE)
print(nrow(notok))
r <- check_depth(abra, report = TRUE, depthmargin = 100, shoremargin = 100)
print(r)
plot_map_leaflet(abra[r$row,], popup = "id")

## End(Not run)

iobis/obistools documentation built on March 19, 2024, 6:27 a.m.