Skip to content

ices-tools-prod/icesDatras

Repository files navigation

Build Status codecov local release CRAN Status CRAN Monthly CRAN Total License

ICES Logo

icesDatras

icesDatras provides R functions that access the web services of the ICES DATRAS trawl survey database.

icesDatras is implemented as an R package and available on CRAN.

DATRAS database support

If you have questions relating to the ICES DATRAS database or web services please email: [email protected]

Installation

icesDatras can be installed from CRAN using the install.packages command:

install.packages("icesDatras")

Usage

For a summary of the package:

library(icesDatras)
?icesDatras

Information on available surveys in DATRAS:

getSurveyList()

Working Examples

Extracting survey haul (HH), lenght (HL) and agebased (CA) data from a given survey, quarter and year, i.e. North Sea IBTS, Quarter 1, 2019:

survey <- "NS-IBTS"
year <- 2019
quarter <- 1

HH <- getHHdata(survey, year, quarter) 
HL <- getHLdata(survey, year, quarter) 
CA <- getCAdata(survey, year, quarter) 

Extracting catch weight of cod from the Baltic Sea survey, year 2019, quarter 1.
Note: The icesVocab package provides findAphia, a function to look up Aphia species codes.

library(icesVocab)
aphia <- icesVocab::findAphia("cod") 

survey <- "BITS"
years <- 2019
quarters <- 1
codwgt <- getCatchWgt(survey, years, quarters, aphia)

Get catch weight for Baltic cod from all quarters in a small timeseries (e.g. 1991 to 2011) and plot the weight in a sipmle graph per quarter.

library(icesVocab)
library(ggplot2)

aphia <- icesVocab::findAphia("cod") 

survey <- "BITS"
years <- 1991:2011
quarters <- 1:4
codwgt <- getCatchWgt(survey, years, quarters, aphia)
codwgt %>% ggplot(aes(x = Year, y = CatchWgt, colour= Quarter)) + geom_point()

References

ICES DATRAS database: http://datras.ices.dk

ICES DATRAS web services: https://datras.ices.dk/WebServices/Webservices.aspx

AphiaID of marine organisms: http://www.marinespecies.org/index.php

Development

icesDatras is developed openly on GitHub.

Feel free to open an issue there if you encounter problems or have suggestions for future versions.

The current development version can be installed using:

library(devtools)
install_github("ices-tools-prod/icesDatras")