Title: | DATRAS Trawl Survey Database Web Services |
---|---|
Description: | R interface to access the web services of the ICES (International Council for the Exploration of the Sea) DATRAS trawl survey database <https://datras.ices.dk/WebServices/Webservices.aspx>. |
Authors: | Colin Millar [aut, cre], Cecilia Kvaavik [aut], Adriana Villamor [aut], Scott Large [aut], Arni Magnusson [aut], Vaishav Soni [ctb] |
Maintainer: | Colin Millar <[email protected]> |
License: | GPL (>= 2) |
Version: | 1.4.2 |
Built: | 2024-10-16 04:31:05 UTC |
Source: | https://github.com/ices-tools-prod/icesDatras |
Checks a survey name against a list of all survey names in the DATRAS database. If the name is not matched it puts up a message showing the available survey names.
checkSurveyOK(survey)
checkSurveyOK(survey)
survey |
the survey acronym, e.g. NS-IBTS. |
logical.
checkSurveyYearOK
and getSurveyYearQuarterList
also perform checks against the DATRAS database.
icesDatras-package
gives an overview of the package.
## Not run: checkSurveyOK(survey = "ROCKALL") checkSurveyOK(survey = "NOTALL") ## End(Not run)
## Not run: checkSurveyOK(survey = "ROCKALL") checkSurveyOK(survey = "NOTALL") ## End(Not run)
Checks a year and/or survey name against a list of all survey year combinations in the DATRAS database. If the combination is not matched it puts up a message showing the available options.
checkSurveyYearOK(survey, year, checksurvey = TRUE)
checkSurveyYearOK(survey, year, checksurvey = TRUE)
survey |
the survey acronym, e.g. NS-IBTS. |
year |
the year of the survey, e.g. 2010. |
checksurvey |
logical, should the survey name also be checked. |
logical.
checkSurveyOK
and checkSurveyYearQuarterOK
also perform checks against the DATRAS database.
icesDatras-package
gives an overview of the package.
## Not run: checkSurveyYearOK(survey = "ROCKALL", 2015) checkSurveyYearOK(survey = "ROCKALL", 2000) checkSurveyYearOK(survey = "NOTALL", 2000) ## End(Not run)
## Not run: checkSurveyYearOK(survey = "ROCKALL", 2015) checkSurveyYearOK(survey = "ROCKALL", 2000) checkSurveyYearOK(survey = "NOTALL", 2000) ## End(Not run)
Checks a quarter and/or year and/or survey name against a list of all survey year quarter combinations in the DATRAS database. If the combination is not matched it puts up a message showing the available options.
checkSurveyYearQuarterOK( survey, year, quarter, checksurvey = TRUE, checkyear = TRUE )
checkSurveyYearQuarterOK( survey, year, quarter, checksurvey = TRUE, checkyear = TRUE )
survey |
the survey acronym, e.g. NS-IBTS. |
year |
the year of the survey, e.g. 2010. |
quarter |
the quarter of the year the survey took place, i.e. 1, 2, 3 or 4. |
checksurvey |
logical, should the survey name also be checked. |
checkyear |
logical, should the year also be checked. |
logical.
checkSurveyOK
and checkSurveyYearOK
also perform checks against the DATRAS database.
icesDatras-package
gives an overview of the package.
## Not run: checkSurveyYearQuarterOK(survey = "ROCKALL", 2015, 3) checkSurveyYearQuarterOK(survey = "ROCKALL", 2015, 1) checkSurveyYearQuarterOK(survey = "ROCKALL", 2000, 1) checkSurveyYearQuarterOK(survey = "NOTALL", 2000, 1) # be careful of unexpected results with checksurvey and checkyear! checkSurveyYearQuarterOK(survey = "NOTALL", 2000, 1, checksurvey=FALSE) ## End(Not run)
## Not run: checkSurveyYearQuarterOK(survey = "ROCKALL", 2015, 3) checkSurveyYearQuarterOK(survey = "ROCKALL", 2015, 1) checkSurveyYearQuarterOK(survey = "ROCKALL", 2000, 1) checkSurveyYearQuarterOK(survey = "NOTALL", 2000, 1) # be careful of unexpected results with checksurvey and checkyear! checkSurveyYearQuarterOK(survey = "NOTALL", 2000, 1, checksurvey=FALSE) ## End(Not run)
Get age-based data such as sex, maturity, and age counts per length of sampled species.
getCAdata(survey, year, quarter)
getCAdata(survey, year, quarter)
survey |
the survey acronym, e.g. NS-IBTS. |
year |
the year of the survey, e.g. 2010. |
quarter |
the quarter of the year the survey took place, i.e. 1, 2, 3 or 4. |
A data frame.
Colin Millar.
getDATRAS
supports querying many years and quarters in one function call.
getHHdata
and getHLdata
get haul data and
length-based data.
icesDatras-package
gives an overview of the package.
## Not run: cadata <- getCAdata(survey = "ROCKALL", year = 2002, quarter = 3) str(cadata) ## End(Not run)
## Not run: cadata <- getCAdata(survey = "ROCKALL", year = 2002, quarter = 3) str(cadata) ## End(Not run)
Calculate the total reported catch weight by species and haul.
getCatchWgt(survey, years, quarters, aphia)
getCatchWgt(survey, years, quarters, aphia)
survey |
the survey acronym e.g. NS-IBTS. |
years |
a vector of years of the survey, e.g. c(2010, 2012) or 2005:2010. |
quarters |
a vector of quarters of the year the survey took place, e.g. c(1, 4) or 1:4. |
aphia |
a vector of Aphia species codes defined in the WoRMS database, e.g. c(126436, 1264374). |
A data frame.
The icesVocab package provides findAphia
, a function to look up Aphia species codes.
getSurveyYearList
, getSurveyYearQuarterList
, and
getDatrasDataOverview
also list available data.
icesDatras-package
gives an overview of the package.
## Not run: getCatchWgt(survey = "ROCKALL", years = 2002, quarters = 3, aphia = 126437) # look up specific species aphia <- icesVocab::findAphia(c("cod", "haddock")) cwt <- getCatchWgt(survey = "ROCKALL", years = 2002, quarters = 3, aphia = aphia) ## End(Not run)
## Not run: getCatchWgt(survey = "ROCKALL", years = 2002, quarters = 3, aphia = 126437) # look up specific species aphia <- icesVocab::findAphia(c("cod", "haddock")) cwt <- getCatchWgt(survey = "ROCKALL", years = 2002, quarters = 3, aphia = aphia) ## End(Not run)
Get CPUE per Age per Haul per Hour for a given Survey, year and Quarter
getCPUEAge(survey, year, quarter)
getCPUEAge(survey, year, quarter)
survey |
the survey acronym, e.g. NS-IBTS. |
year |
the year of the survey, e.g. 2010. |
quarter |
the quarter of interest, e.g. 1 |
A data frame.
Adriana Villamor.
getHHdata
and getCAdata
get haul data and
age-based data., and
getIndices
, and
getCPUELength
.
icesDatras-package
gives an overview of the package.
## Not run: getCPUEperAge(survey = "NS-IBTS", year = 2018, quarter = 1) ## End(Not run)
## Not run: getCPUEperAge(survey = "NS-IBTS", year = 2018, quarter = 1) ## End(Not run)
Get CPUE per Length per Haul per Hour for a given Survey, year and Quarter
getCPUELength(survey, year, quarter)
getCPUELength(survey, year, quarter)
survey |
the survey acronym, e.g. NS-IBTS. |
year |
the year of the survey, e.g. 2010. |
quarter |
the quarter of interest, e.g. 1 |
A data frame.
Adriana Villamor.
getHHdata
and getCAdata
get haul data and
age-based data., and
getIndices
, and
getCPUEAge
.
icesDatras-package
gives an overview of the package.
## Not run: getCPUELength(survey = "NS-IBTS", year = 2018, quarter = 1) ## End(Not run)
## Not run: getCPUELength(survey = "NS-IBTS", year = 2018, quarter = 1) ## End(Not run)
This function combines the functionality of getHHdata, getHLdata, and getCAdata. It supports querying many years and quarters in one function call.
getDATRAS(record = "HH", survey, years, quarters)
getDATRAS(record = "HH", survey, years, quarters)
record |
the data type required: "HH" haul data, "HL" length-based data, "CA" age-based data. |
survey |
the survey acronym e.g. NS-IBTS. |
years |
a vector of years of the survey, e.g. c(2010, 2012) or 2005:2010. |
quarters |
a vector of quarters of the year the survey took place, i.e. c(1, 4) or 1:4. |
A data frame.
Scott Large and Colin Millar.
getHHdata
, getHLdata
, and getCAdata
get haul data, length-based data, and age-based data.
icesDatras-package
gives an overview of the package.
## Not run: hhdata <- getDATRAS(record = "HH", survey = "ROCKALL", years = 2002, quarters = 3) hldata <- getDATRAS(record = "HL", survey = "ROCKALL", years = 2002, quarters = 3) cadata <- getDATRAS(record = "CA", survey = "ROCKALL", years = 2002, quarters = 3) ## End(Not run)
## Not run: hhdata <- getDATRAS(record = "HH", survey = "ROCKALL", years = 2002, quarters = 3) hldata <- getDATRAS(record = "HL", survey = "ROCKALL", years = 2002, quarters = 3) cadata <- getDATRAS(record = "CA", survey = "ROCKALL", years = 2002, quarters = 3) ## End(Not run)
Evaluate a presence-absence table for each survey with '1' where there is data and '0' (printed as '.') otherwise.
getDatrasDataOverview(surveys = NULL, long = TRUE)
getDatrasDataOverview(surveys = NULL, long = TRUE)
surveys |
a vector of survey names, or |
long |
whether tables should have year as row names (default) or column names. |
A list of tables.
getSurveyList
, getSurveyYearList
, and
getSurveyYearQuarterList
also list available data.
icesDatras-package
gives an overview of the package.
## Not run: getDatrasDataOverview(surveys = "ROCKALL", long = FALSE) ## End(Not run)
## Not run: getDatrasDataOverview(surveys = "ROCKALL", long = FALSE) ## End(Not run)
Get all information in HH plus estimates of Door Spread, Wing Spread and Swept Area per square km. Only available for NS-IBTS survey.
getFlexFile(survey, year, quarter)
getFlexFile(survey, year, quarter)
survey |
the survey acronym, e.g. NS-IBTS. |
year |
the year of the survey, e.g. 2010. |
quarter |
the quarter of the year the survey took place, i.e. 1, 2, 3 or 4. |
A data frame.
Adriana Villamor.
getDATRAS
supports querying many years and quarters in one function call.
getHHdata
get haul data
icesDatras-package
gives an overview of the package.
## Not run: flex <- getFlexFile(survey = "NS-IBTS", year = 2020, quarter = 1) str(flex) # error checking examples: flex <- getFlexFile(survey = "NS_IBTS", year = 2016, quarter = 1) flex <- getFlexFile(survey = "NS-IBTS", year = 2030, quarter = 1) flex <- getFlexFile(survey = "NS-IBTS", year = 2016, quarter = 6) ## End(Not run)
## Not run: flex <- getFlexFile(survey = "NS-IBTS", year = 2020, quarter = 1) str(flex) # error checking examples: flex <- getFlexFile(survey = "NS_IBTS", year = 2016, quarter = 1) flex <- getFlexFile(survey = "NS-IBTS", year = 2030, quarter = 1) flex <- getFlexFile(survey = "NS-IBTS", year = 2016, quarter = 6) ## End(Not run)
Get haul data such as position, depth, sampling method, etc.
getHHdata(survey, year, quarter)
getHHdata(survey, year, quarter)
survey |
the survey acronym, e.g. NS-IBTS. |
year |
the year of the survey, e.g. 2010. |
quarter |
the quarter of the year the survey took place, i.e. 1, 2, 3 or 4. |
A data frame.
Colin Millar.
getDATRAS
supports querying many years and quarters in one function call.
getHLdata
and getCAdata
get length-based data and
age-based data.
icesDatras-package
gives an overview of the package.
## Not run: hhdata <- getHHdata(survey = "ROCKALL", year = 2002, quarter = 3) str(hhdata) # error checking examples: hhdata <- getHHdata(survey = "NS_IBTS", year = 2016, quarter = 1) hhdata <- getHHdata(survey = "NS-IBTS", year = 2030, quarter = 1) hhdata <- getHHdata(survey = "NS-IBTS", year = 2016, quarter = 6) ## End(Not run)
## Not run: hhdata <- getHHdata(survey = "ROCKALL", year = 2002, quarter = 3) str(hhdata) # error checking examples: hhdata <- getHHdata(survey = "NS_IBTS", year = 2016, quarter = 1) hhdata <- getHHdata(survey = "NS-IBTS", year = 2030, quarter = 1) hhdata <- getHHdata(survey = "NS-IBTS", year = 2016, quarter = 6) ## End(Not run)
Get length-based information such as measured length, individual counts, and sub-factors of sampled species.
getHLdata(survey, year, quarter, species)
getHLdata(survey, year, quarter, species)
survey |
the survey acronym, e.g. NS-IBTS. |
year |
the year of the survey, e.g. 2010. |
quarter |
the quarter of the year the survey took place, i.e. 1, 2, 3 or 4. |
species |
the valid aphia code of the species to download, if NULL all species are included |
A data frame.
getDATRAS
supports querying many years and quarters in one function call.
getHHdata
and getCAdata
get haul data and
age-based data.
icesDatras-package
gives an overview of the package.
## Not run: hldata <- getHLdata(survey = "BTS", year = 1993, quarter = 3, species = 105883) str(hldata) ## End(Not run)
## Not run: hldata <- getHLdata(survey = "BTS", year = 1993, quarter = 3, species = 105883) str(hldata) ## End(Not run)
Get age based indices of abundance by species, survey and year.
getIndices(survey, year, quarter, species)
getIndices(survey, year, quarter, species)
survey |
the survey acronym, e.g. NS-IBTS. |
year |
the year of the survey, e.g. 2010. |
quarter |
the quarter of the year the survey took place, i.e. 1, 2, 3 or 4. |
species |
the aphia species code for the species of interest. |
A data frame.
The icesAdvice package provides findAphia
, a function to look up Aphia species codes.
getDATRAS
supports querying many years and quarters in one function call.
getHHdata
and getCAdata
get haul data and
age-based data.
icesDatras-package
gives an overview of the package.
## Not run: haddock_aphia <- icesVocab::findAphia("haddock") index <- getIndices(survey = "NS-IBTS", year = 2002, quarter = 3, species = haddock_aphia) str(index) ## End(Not run)
## Not run: haddock_aphia <- icesVocab::findAphia("haddock") index <- getIndices(survey = "NS-IBTS", year = 2002, quarter = 3, species = haddock_aphia) str(index) ## End(Not run)
Get Litter assessment output by survey, year and quarter. The raw data are also included in this file.
getLTassessment(survey, year, quarter)
getLTassessment(survey, year, quarter)
survey |
the survey acronym, e.g. NS-IBTS. |
year |
the year of the survey, e.g. 2010. |
quarter |
the quarter of the year the survey took place, i.e. 1, 2, 3 or 4. |
A data frame.
The icesAdvice package provides findAphia
, a function to look up Aphia species codes.
getDATRAS
supports querying many years and quarters in one function call.
getHHdata
and getCAdata
get haul data and
age-based data.
icesDatras-package
gives an overview of the package.
## Not run: index <- getLTassessment(survey = "NS-IBTS", year = 2002, quarter = 3) str(index) ## End(Not run)
## Not run: index <- getLTassessment(survey = "NS-IBTS", year = 2002, quarter = 3) str(index) ## End(Not run)
Get a list of all survey acronyms.
getSurveyList()
getSurveyList()
A character vector.
Colin Millar.
getSurveyYearList
, getSurveyYearQuarterList
, and
getDatrasDataOverview
also list available data.
icesDatras-package
gives an overview of the package.
## Not run: getSurveyList() ## End(Not run)
## Not run: getSurveyList() ## End(Not run)
Get a list of all data years for a given survey.
getSurveyYearList(survey)
getSurveyYearList(survey)
survey |
the survey acronym, e.g. NS-IBTS. |
A numeric vector.
Colin Millar.
getSurveyList
, getSurveyYearQuarterList
, and
getDatrasDataOverview
also list available data.
icesDatras-package
gives an overview of the package.
## Not run: getSurveyYearList(survey = "ROCKALL") ## End(Not run)
## Not run: getSurveyYearList(survey = "ROCKALL") ## End(Not run)
Get a list of quarters available for a given survey and year.
getSurveyYearQuarterList(survey, year)
getSurveyYearQuarterList(survey, year)
survey |
the survey acronym, e.g. NS-IBTS. |
year |
the year of the survey, e.g. 2010. |
A numeric vector.
Colin Millar.
getSurveyYearList
, getSurveyYearQuarterList
, and
getDatrasDataOverview
also list available data.
icesDatras-package
gives an overview of the package.
## Not run: getSurveyYearQuarterList(survey = "ROCKALL", year = 2002) ## End(Not run)
## Not run: getSurveyYearQuarterList(survey = "ROCKALL", year = 2002) ## End(Not run)
R interface to access the web services of the ICES DATRAS trawl survey database.
Exchange data:
getHHdata |
haul data |
getHLdata |
length-based data |
getCAdata |
age-based data |
getDATRAS |
exchange data |
Catch weights:
getCatchWgt |
catch weights |
Survey indices:
getIndices |
survey indices |
Overview of available data:
getSurveyList |
surveys |
getSurveyYearList |
years |
getSurveyYearQuarterList |
quarters |
getDatrasDataOverview |
surveys, years, and quarters |
Basic queries (thin web service wrappers):getCAdata
,
getHHdata
,
getHLdata
,
getIndices
,
getSurveyList
,
getSurveyYearList
,
getSurveyYearQuarterList
Derived queries (combining web services with R computations):getCatchWgt
,
getDatrasDataOverview
,
getDATRAS
Colin Millar, Scott Large, and Arni Magnusson.
ICES DATRAS database: http://datras.ices.dk.
ICES DATRAS web services: https://datras.ices.dk/WebServices/Webservices.aspx.