Package 'icesASD'

Title: Advice and Scenarios Database Web Services
Description: R interface to access the web services of the ICES Advice and Scenarios database <https://asd.ices.dk/AdviceList>.
Authors: Colin Millar [aut, cre], Luca Lamoni [aut], Carlos Pinto [aut], Laura Petre [aut], David Miller [ctb], Neil Maginis [ctb]
Maintainer: Colin Millar <[email protected]>
License: GPL (>= 2)
Version: 0.0.1
Built: 2024-12-14 03:04:38 UTC
Source: https://github.com/ices-tools-prod/icesASD

Help Index


Stock Advice and Scenarios Database Web Services

Description

R interface to access the web services of the ICES Stock Advice and Scenarios database.

Details

Get dataset:

getAdviceViewRecord Get Advice Record
getCatchScenariosTable Get Advice Catch Scenario Table
getCatchScenariosNotes Get Advice Catch Scenario Table Footnotes

Author(s)

Colin Millar, Luca Lamoni, Carlos Pinto, Laura Petre, David Miller and Neil Maginis.

References

ICES Advice and Scenarios database: http://sg.ices.dk.

ICES Advice and Scenarios database web services: http://sg.ices.dk/webservices.aspx.


Download advice scenarios

Description

Download a zip file of a set of advice scenarios

Usage

adviceDownload(adviceKeys, dir = ".")

Arguments

adviceKeys

a vector of advice view ids.

dir

directory to download to.

Examples

## Not run: 
adviceDownload(c(1009, 1011, 1022))

## End(Not run)

Create The ASD Webservice URL

Description

utility to build a url with optional query arguments

Usage

asd_api(service, ...)

Arguments

service

the name of the service

...

named arguments will be added as queries

Value

a complete url as a character string

Examples

asd_api("hi", bye = 21)
asd_api("csquares", argument1 = 2021, argument2 = NULL)

Get Advice Catch Scenario Table

Description

Returns the catch scenario table for the selected stock and year using the advice view web service.

Usage

get_catch_scenario_table(adviceKey, assessmentYear)

Arguments

adviceKey

integer value of stock adviceKey

assessmentYear

integer value of assessment year

Value

data.frame containing the catch scenarios table for the advice view record

References

https://sg.ices.dk/adviceview/AdviceList

Examples

get_catch_scenario_table(3056,2022)

Get Advice View Record

Description

Get Advice View Record

Usage

getAdviceViewRecord(stockcode = NULL, year = NULL, assessmentKey = NULL)

Arguments

stockcode

string value of the stock code you wish to look

year

integer value of assessment year

assessmentKey

integer value of SAG assessmentKey

Examples

catch_scenario_list <- getAdviceViewRecord()
head(catch_scenario_list, 3)

getAdviceViewRecord("bll.27.3a47de", 2021, 15609)

Get Catch Scenarios Notes

Description

Get Catch Scenarios Notes for a given record

Usage

getCatchScenariosNotes(adviceKey)

Arguments

adviceKey

advice view id(s)

Examples

catch_scenario_note <- getCatchScenariosNotes(2814)
catch_scenario_notes <- getCatchScenariosNotes(c(2814, 2815))

Get Catch Scenarios Table

Description

Get Catch Scenarios Table for a given record

Usage

getCatchScenariosTable(adviceKey)

Arguments

adviceKey

advice view id(s)

Examples

catch_scenario_table <- getCatchScenariosTable(2814)
catch_scenario_tables <- getCatchScenariosTable(c(2814, 2815))

Read a file in the ASD upload format

Description

Read a file in the ASD upload format, returning a list of metadata and data.frame

Usage

readAsdUpload(filename, format = FALSE)

Arguments

filename

the file path of the file to read

format

should the output be formatted into an easy to read table

Examples

filename <- system.file("CatchScenarios_AdviceKey_3207.xml", package = "icesASD")
asd <- readAsdUpload(filename)

Screen an ASD file and submit for QC checks

Description

In this web service the user can upload a file to be screen and validated by the VMS database. The service can be called using post and the file will have to be part of the body of the call. The user needs to be authenticated in order to call this service. This file can be later pushed to the database by the same user.

Usage

screen_asd_file(file, verbose = FALSE)

Arguments

file

file name of the file containing the data to screen

verbose

return verbose information about the POST request

Value

text message from the screening process

Examples

## Not run: 
# requires authorization
filename <- system.file("test_files/vms_test.csv", package = "icesVMS")
screen_vms_file(filename)

## End(Not run)