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:

library(SHARK4R)
suppressPackageStartupMessages({
  library(SHARK4R)
})

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)

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)

# View available datatypes
dataTypes <- shark_options$dataTypes
print(dataTypes)

Citation

# Print citation
citation("SHARK4R")


sharksmhi/SHARK4R documentation built on Jan. 9, 2025, 5:15 p.m.