Skip to contents

SHARK

SHARK is the Swedish Ocean Archive’s platform for data downloads. It stores biological, physical, and chemical marine environmental monitoring data. On behalf of the Swedish Agency for Marine and Water Management, SMHI serves as the national data host for oceanography and marine biology and is designated by UNESCO as a National Oceanographic Data Center (NODC). The data can be accessed via a web interface or through the API, as demonstrated in this tutorial using SHARK4R.

Getting Started

Installation

You can install the package from GitHub using the devtools package:

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

Load the SHARK4R library:

Retrieve Data Table

Data can be retrieved with the same filtering options available in SHARK. To see the available filtering options, please refer to get_shark_options and the information below.

# Retrieve chlorophyll data for April to June from 2019 to 2020
shark_data <- get_shark_data(fromYear = 2019, 
                             toYear = 2020,
                             months = c(4, 5, 6), 
                             dataTypes = c("Chlorophyll"),
                             verbose = FALSE)

# Print data
print(shark_data)
## # A tibble: 263 × 72
##    delivery_datatype check_status_sv data_checked_by_sv visit_year visit_month
##    <chr>             <chr>           <chr>                   <dbl>       <dbl>
##  1 Chlorophyll       Klar            Leverantör               2020           6
##  2 Chlorophyll       Klar            Leverantör               2020           6
##  3 Chlorophyll       Klar            Leverantör               2020           6
##  4 Chlorophyll       Klar            Leverantör               2020           6
##  5 Chlorophyll       Klar            Leverantör               2020           6
##  6 Chlorophyll       Klar            Leverantör               2020           6
##  7 Chlorophyll       Klar            Leverantör               2020           6
##  8 Chlorophyll       Klar            Leverantör               2020           6
##  9 Chlorophyll       Klar            Leverantör               2020           6
## 10 Chlorophyll       Klar            Leverantör               2020           6
## # ℹ 253 more rows
## # ℹ 67 more variables: station_name <chr>, reported_station_name <chr>,
## #   sample_location_id <dbl>, station_id <dbl>, sample_project_name_sv <chr>,
## #   sample_orderer_name_sv <chr>, visit_id <dbl>, visit_date <lgl>,
## #   shark_sample_id_md5 <chr>, sample_date <date>, sample_time <time>,
## #   sample_enddate <lgl>, sample_endtime <lgl>, sample_latitude_dm <chr>,
## #   sample_longitude_dm <chr>, sample_latitude_dd <dbl>, …

Get SHARK API Options

Filtering options, including data types, dataset names, stations, taxa, and more, can be retrieved using the get_shark_options function.

# Retrieve available search options
shark_options <- get_shark_options()

# List the names of the available options
names(shark_options)
##  [1] "datasets"              "dataTypes"             "parameters"           
##  [4] "minYear"               "maxYear"               "months"               
##  [7] "checkStatuses"         "qualityFlags"          "deliverers"           
## [10] "orderers"              "projects"              "redListedCategories"  
## [13] "taxa"                  "stations"              "seaAreas"             
## [16] "vattenDistrikt"        "typOmraden"            "seaBasins"            
## [19] "counties"              "municipalities"        "waterCategories"      
## [22] "helcomOspar"           "parametersForDatatype" "headerlangers"        
## [25] "minYearPerDatatype"
# View available datatypes
dataTypes <- shark_options$dataTypes
print(dataTypes)
##  [1] "Bacterioplankton"      "Chlorophyll"           "Grey seal"            
##  [4] "Harbour Porpoise"      "Harbour seal"          "Jellyfish"            
##  [7] "Physical and Chemical" "Phytoplankton"         "Picoplankton"         
## [10] "PlanktonBarcoding"     "Primary production"    "Ringed seal"          
## [13] "Seal pathology"        "Sedimentation"         "Zooplankton"

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},
##   }