Quality Control
Listed functions can be used for quality control of SHARK data.
Check required fields
check_datatype()
will check if all global SHARK required
fields are present in an occurrence table and if any values are missing.
These functions returns a dataframe of errors (if any).
Plot points on a map
plot_map()
will generate a ggplot2 map of occurrence
records, plot_map_leaflet()
creates a zoomable interactive
Leaflet map.
Check points on land
check_onland()
uses the xylookup web service which
internally uses land polygons from OpenStreetMap to check if any points
are located on land. Other shapefiles can be used as well.
Check depth
check_depth()
uses the xylookup web service to identify
which records have potentially invalid depths. Multiple checks are
performed in this function: missing depth column (warning) empty depth
column (warning) depth values that can’t be converted to numbers (error)
values that are larger than the depth value in the bathymetry layer,
after applying the provided depthmargin (error) depth values that are
negative for off shore points, after applying the provided shoremargin
(error) minimum depth greater than maximum depth (error)
Check outliers
check_outliers_dataset()
use the qc-service web service
to identify which records are statistical outliers. For species outlier
checks are performed for both environmental data (bathymetry, sea
surface salinity and sea surface temperature) as well as spatially.
Outliers are identified as all points that deviate more then six times
the median absolute deviation (MAD) or three times the interquartile
range (IQR) from the median. The list in the extra field of the debug
level output in the report provides all relevant statistics on which the
outlier analysis is based. The report also gives an overview of these
outliers. Outliers can be plotted with
plot_outliers(report)
iRfcb functions
ifcb_is_near_land()
and ifcb_which_basin()
are functions sourced from the iRfcb package,
and can be used for geospatial quality control of SHARK data.
Citation
## To cite package 'SHARK4R' in publications use:
##
## Markus Lindh, Anders Torstensson (2025). SHARK4R: Retrieving,
## Analyzing, and Validating Marine Data from SHARK and Nordic
## Microalgae. R package version 0.1.7.
## https://doi.org/10.5281/zenodo.14169399
##
## A BibTeX entry for LaTeX users is
##
## @Manual{,
## title = {SHARK4R: Retrieving, Analyzing, and Validating Marine Data from SHARK and Nordic Microalgae},
## author = {Markus Lindh and Anders Torstensson},
## year = {2025},
## note = {R package version 0.1.7},
## url = {https://doi.org/10.5281/zenodo.14169399},
## }