Learn R Programming

SHARK4R: Accessing and Validating Marine Environmental Data from 'SHARK' and Related Databases

Overview

This R package is equipped with a client application designed for integration with API functions. It facilitates access to various databases, including SHARK, SLU Artdatabanken (Dyntaxa), WoRMS, AlgaeBase, IOC-UNESCO Taxonomic Reference List of Harmful Micro Algae, IOC-UNESCO Toxins database, OBIS xylookup web service and Nordic Microalgae. The package serves a dual purpose, supporting both data analysis and automatic quality control of physical, chemical, and marine biological data. Several quality control components, originally developed by Provoost and Bosch (2024), have been adapted for compatibility with the SHARK format.

Installation

You can install the latest version of SHARK4R from CRAN using:

install.packages("SHARK4R")

Or install the development version (requiring the remotes package):

# install.packages("remotes")
remotes::install_github("sharksmhi/SHARK4R", 
                        dependencies = TRUE)

Documentation and Tutorials

Website

For detailed information, please visit the project's webpage.

Tutorials

Explore the features and capabilities of SHARK4R through these tutorials:

Reference

For a detailed overview of all available SHARK4R functions, please visit the reference section:

Repository

For more details and the latest updates, visit the GitHub repository.

License

This package is licensed under the MIT License.

References

Provoost P, Bosch S (2024). obistools: Tools for data enhancement and quality control. Ocean Biodiversity Information System. Intergovernmental Oceanographic Commission of UNESCO. R package version 0.1.0, https://iobis.github.io/obistools/.

Copy Link

Version

Install

install.packages('SHARK4R')

Version

1.0.2

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Anders Torstensson

Last Published

December 12th, 2025

Functions in SHARK4R (1.0.2)

check_deliv_Bacterioplankton

Check if the required and recommended datatype-specific SHARK system fields are present
check_deliv_Chlorophyll

Check if the required and recommended datatype-specific SHARK system fields are present
check_Phytoplankton

Check if the required and recommended datatype-specific SHARK system fields are present
check_bacterial_carbon

Uses data from national marine monitoring for the last 5 years to identify outliers
check_datatype

Validate SHARK system fields in a data frame
check_codes

Check matches of reported codes in SMHI's SHARK codelist
check_deliv_SealPathology

Check if the required and recommended datatype-specific SHARK system fields are present
check_deliv_Sedimentation

Check if the required and recommended datatype-specific SHARK system fields are present
check_deliv_HarbourSeal

Check if the required and recommended datatype-specific SHARK system fields are present
check_bacterial_production

Uses data from national marine monitoring for the last 5 years to identify outliers
check_deliv_Epibenthos

Check if the required and recommended datatype-specific SHARK system fields are present
check_epibenthos_counted

Uses data from national marine monitoring for the last 5 years to identify outliers
check_deliv_Picoplankton

Check if the required and recommended datatype-specific SHARK system fields are present
check_deliv_PhysicalChemical

Check if the required and recommended datatype-specific SHARK system fields are present
check_SealPathology

Check if the required and recommended datatype-specific SHARK system fields are present
check_deliv_EpibenthosDropvideo

Check if the required and recommended datatype-specific SHARK system fields are present
check_bacterial_concentration

Uses data from national marine monitoring for the last 5 years to identify outliers
check_deliv_Phytoplankton

Check if the required and recommended datatype-specific SHARK system fields are present
check_epibenthos_cover_logical

Check if Epibenthos cover exceeds 100%
check_epibenthos_dryweight

Uses data from national marine monitoring for the last 5 years to identify outliers
check_deliv_GreySeal

Check if the required and recommended datatype-specific SHARK system fields are present
check_deliv_HarbourPorpoise

Check if the required and recommended datatype-specific SHARK system fields are present
check_epibenthos_sedimentdepos_logical

Check if Sediment deposition cover (%) exceeds 100%
check_deliv_PrimaryProduction

Check if the required and recommended datatype-specific SHARK system fields are present
check_onland

Check whether points are located on land
check_nominal_station

Check if stations are reported as nominal positions
check_picoplankton_abundance

Uses data from national marine monitoring for the last 5 years to identify outliers
check_logical_parameter

General checker for parameter-specific logical rules
check_harbporp_positivemin

Uses data from national marine monitoring for the last 5 years to identify outliers
check_chlorophyll_conc

Uses data from national marine monitoring for the last 5 years to identify outliers
check_picoplankton_biovol

Uses data from national marine monitoring for the last 5 years to identify outliers
check_depth

Validate depth values against bathymetry and logical constraints
check_phytoplankton_abund

Uses data from national marine monitoring for the last 5 years to identify outliers
check_epibenthos_totcover_logical

Check if Epibenthos total cover exceeds 100%
check_fields

Validate SHARK data fields for a given datatype
check_zoobenthos_wetweight

Uses data from national marine monitoring for the last 5 years to identify outliers
check_phytoplankton_carbon

Uses data from national marine monitoring for the last 5 years to identify outliers
check_epibenthos_abundclass_logical

Check if Abundance class exceeds 10
check_zero_value

Identify records with zero-valued measurement data
check_deliv_RingedSeal

Check if the required and recommended datatype-specific SHARK system fields are present
check_primaryproduction_carbonprod

Uses data from national marine monitoring for the last 5 years to identify outliers
check_deliv_Zoobenthos

Check if the required and recommended datatype-specific SHARK system fields are present
check_zoobenthos_BQIm

Uses data from national marine monitoring for the last 5 years to identify outliers
check_epibenthos_coverclass_logical

Check if Epibenthos cover class exceeds 10
check_code_proj

Check matches of reported codes in SMHI's SHARK codelist
check_zooplankton_length_mean

Uses data from national marine monitoring for the last 5 years to identify outliers
check_primaryproduction_carbonprod_hour

Uses data from national marine monitoring for the last 5 years to identify outliers
check_zoobenthos_counted

Uses data from national marine monitoring for the last 5 years to identify outliers
check_phytoplankton_counted

Uses data from national marine monitoring for the last 5 years to identify outliers
clean_shark4r_cache

Clean SHARK4R cache by file age and session
check_zoobenthos_BQIm_logical

Check logical relationship between Abundance and BQIm
check_zoobenthos_abund

Uses data from national marine monitoring for the last 5 years to identify outliers
check_zooplankton_wetweight_volume

Uses data from national marine monitoring for the last 5 years to identify outliers
check_deliv_Zooplankton

Check if the required and recommended datatype-specific SHARK system fields are present
check_zooplankton_length_median

Uses data from national marine monitoring for the last 5 years to identify outliers
check_greyseal_counted

Uses data from national marine monitoring for the last 5 years to identify outliers
check_epibenthos_coverpercent_logical

Check if Epibenthos cover (%) exceeds 100%
get_dyntaxa_records

Get taxonomic information from Dyntaxa for specified taxon IDs
get_dyntaxa_parent_ids

Get parent taxon IDs for specified taxon IDs from Dyntaxa
get_algaebase_species

Search AlgaeBase for information about a species of algae
get_algaebase_genus

Search AlgaeBase for information about a genus of algae
check_phytoplankton_biovol

Uses data from national marine monitoring for the last 5 years to identify outliers
check_station_distance

Check station distances against SMHI station list
check_setup

Download and set up SHARK4R support files
get_nua_taxa

Retrieve taxa information from Nordic Microalgae
construct_dyntaxa_table

Construct a hierarchical taxonomy table from Dyntaxa
get_nua_media_links

Retrieve and extract media URLs from Nordic Microalgae
convert_ddmm_to_dd

Convert coordinates from DDMM format to decimal degrees
check_zoobenthos_wetweight_logical

Check if wet weight measurements are zero
check_zooplankton_abund

Uses data from national marine monitoring for the last 5 years to identify outliers
check_epibenthos_specdistr_maxdepth

Uses data from national marine monitoring for the last 5 years to identify outliers
check_harbourseal_counted

Uses data from national marine monitoring for the last 5 years to identify outliers
get_peg_list

Get the latest EG-Phyto/PEG biovolume Excel list
check_zooplankton_wetweight_area

Uses data from national marine monitoring for the last 5 years to identify outliers
check_zooplankton_wetweight

Uses data from national marine monitoring for the last 5 years to identify outliers
get_shark_codes

Get SHARK codelist from SMHI
get_worms_records

Retrieve WoRMS records
get_dyntaxa_dwca

Download and read Darwin Core Archive files from Dyntaxa
get_delivery_template

Get a delivery template for a SHARK datatype
get_worms_classification

Retrieve hierarchical classification from WoRMS
get_shark_table_counts

Retrieve SHARK data table row counts
check_picoplankton_carbon

Uses data from national marine monitoring for the last 5 years to identify outliers
check_epibenthos_specdistr_mindepth

Uses data from national marine monitoring for the last 5 years to identify outliers
check_picoplankton_counted

Uses data from national marine monitoring for the last 5 years to identify outliers
check_parameter_rules

Check parameter values against logical rules
check_outliers

General outlier check function for SHARK data
get_worms_taxonomy_tree

Retrieve hierarchical taxonomy data from WoRMS
check_value_logical

Identify non-numeric or non-logical values in measurement data
check_zero_positions

Identify samples with zero-valued station coordinates
lookup_xy

Lookup spatial information for geographic points
match_dyntaxa_taxa

Match Dyntaxa taxon names
match_algaebase_species

Search AlgaeBase for information about a species of algae
match_algaebase_genus

Search AlgaeBase for information about a genus of algae
load_shark4r_stats

Load SHARK4R statistics from GitHub
get_toxin_list

Retrieve marine biotoxin data from IOC-UNESCO Toxins Database
read_ptbx

Read a Plankton Toolbox export file
match_station

Match station names against SMHI station list
get_nua_external_links

Retrieve external links or facts for taxa from Nordic Microalgae
get_nua_harmfulness

Retrieve harmfulness for taxa from Nordic Microalgae
load_shark4r_fields

Load SHARK4R fields from GitHub
is_in_dyntaxa

Check if taxon names exist in Dyntaxa
get_shark_statistics

Summarize numeric SHARK parameters with ranges and outlier thresholds
get_shark_options

Retrieve available search options from SHARK
match_algaebase_taxa

Search AlgaeBase for taxonomic information
get_worms_records_name

Retrieve WoRMS records by taxonomic names with retry logic
load_station_bundle

Load station database (station.txt) from path, NODC_CONFIG, or package bundle
match_algaebase

Search AlgaeBase for taxonomic information
read_shark

Read SHARK export files (tab- or semicolon-delimited, plain text or zipped)
read_shark_deliv

Read SHARK Excel delivery files (.xls or .xlsx)
shark_read_deliv

Read .xlsx files delivered to SHARK
plot_map_leaflet_deliv

Create a Leaflet map.
shark_read_deliv_xls

Read .xls files delivered to SHARK
translate_shark_datatype

Translate SHARK4R datatype names
run_qc_app

Launch the SHARK4R Bio-QC Tool
shark_read_zip

Read zip archive and unzip tab delimited files downloaded from SHARK
get_hab_list

Download the IOC-UNESCO Taxonomic Reference List of Harmful Micro Algae
find_required_fields

Find required fields in a SHARK delivery template
scatterplot

Scatterplot with optional horizontal threshold lines
check_ringedseal_calccounted

Uses data from national marine monitoring for the last 5 years to identify outliers
which_basin

Determine if points are in a specified sea basin
positions_are_near_land

Determine if positions are near land
match_dyntaxa

Taxon matching using Dyntaxa (https://www.dyntaxa.se/)
check_zooplankton_carbon

Uses data from national marine monitoring for the last 5 years to identify outliers
defunct

Defunct functions
check_zooplankton_counted

Uses data from national marine monitoring for the last 5 years to identify outliers
check_primaryproduction_carbonprodlight

Uses data from national marine monitoring for the last 5 years to identify outliers
match_worms_taxa

Retrieve WoRMS records by taxonomic names with retry logic
shark_read

Read tab delimited files downloaded from SHARK
match_taxon_name

Match Dyntaxa taxon names
get_nomp_list

Get the latest NOMP biovolume Excel list
ifcb_is_near_land

Determine if positions are near land
get_shark_datasets

Download SHARK dataset zip archives
get_shark_data

Retrieve tabular data from SHARK
parse_scientific_names

Parse scientific names into genus and species components.
nominal_station

Check if stations are reported as nominal positions
ifcb_which_basin

Determine if points are in a specified sea basin
match_wormstaxa

Taxon matching using WoRMS (http://www.marinespecies.org/)
update_dyntaxa_taxonomy

Update SHARK taxonomy records using Dyntaxa
plot_map_leaflet

Create an interactive Leaflet map of sampling stations
update_worms_taxonomy

Retrieve and organize WoRMS taxonomy for SHARK Aphia IDs
check_EpibenthosDropvideo

Check if the required and recommended datatype-specific SHARK system fields are present
assign_phytoplankton_group

Assign phytoplankton group to scientific names
add_worms_taxonomy

Add WoRMS taxonomy hierarchy to AphiaIDs or scientific names
check_Bacterioplankton

Check if the required and recommended datatype-specific SHARK system fields are present
check_HarbourSeal

Check if the required and recommended datatype-specific SHARK system fields are present
check_PhysicalChemical

Check if the required and recommended datatype-specific SHARK system fields are present
check_Epibenthos

Check if the required and recommended datatype-specific SHARK system fields are present
SHARK4R-package

SHARK4R: Accessing and Validating Marine Environmental Data from 'SHARK' and Related Databases
check_Zoobenthos

Check if the required and recommended datatype-specific SHARK system fields are present
check_PrimaryProduction

Check if the required and recommended datatype-specific SHARK system fields are present
check_Chlorophyll

Check if the required and recommended datatype-specific SHARK system fields are present
check_Picoplankton

Check if the required and recommended datatype-specific SHARK system fields are present
check_Sedimentation

Check if the required and recommended datatype-specific SHARK system fields are present
check_GreySeal

Check if the required and recommended datatype-specific SHARK system fields are present
check_RingedSeal

Check if the required and recommended datatype-specific SHARK system fields are present
check_Zooplankton

Check if the required and recommended datatype-specific SHARK system fields are present
check_HarbourPorpoise

Check if the required and recommended datatype-specific SHARK system fields are present