check_depth: Check which points have potentially invalid depths.

Description Usage Arguments Details Value See Also Examples

View source: R/check_depth.R

Description

Check which points have potentially invalid depths.

Usage

1
2
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

Raster* 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

1
2
3
4
5
6
7
8
## 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)

sharksmhi/tryout documentation built on Dec. 27, 2019, 5:34 a.m.