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-11-14 03:43:23 UTC |
Source: | https://github.com/ices-tools-prod/icesASD |
R interface to access the web services of the ICES Stock Advice and Scenarios database.
Get dataset:
getAdviceViewRecord |
Get Advice Record |
getCatchScenariosTable |
Get Advice Catch Scenario Table |
getCatchScenariosNotes |
Get Advice Catch Scenario Table Footnotes |
Colin Millar, Luca Lamoni, Carlos Pinto, Laura Petre, David Miller and Neil Maginis.
ICES Advice and Scenarios database: http://sg.ices.dk.
ICES Advice and Scenarios database web services: http://sg.ices.dk/webservices.aspx.
Download a zip file of a set of advice scenarios
adviceDownload(adviceKeys, dir = ".")
adviceDownload(adviceKeys, dir = ".")
adviceKeys |
a vector of advice view ids. |
dir |
directory to download to. |
## Not run: adviceDownload(c(1009, 1011, 1022)) ## End(Not run)
## Not run: adviceDownload(c(1009, 1011, 1022)) ## End(Not run)
utility to build a url with optional query arguments
asd_api(service, ...)
asd_api(service, ...)
service |
the name of the service |
... |
named arguments will be added as queries |
a complete url as a character string
asd_api("hi", bye = 21) asd_api("csquares", argument1 = 2021, argument2 = NULL)
asd_api("hi", bye = 21) asd_api("csquares", argument1 = 2021, argument2 = NULL)
Returns the catch scenario table for the selected stock and year using the advice view web service.
get_catch_scenario_table(adviceKey, assessmentYear)
get_catch_scenario_table(adviceKey, assessmentYear)
adviceKey |
integer value of stock adviceKey |
assessmentYear |
integer value of assessment year |
data.frame containing the catch scenarios table for the advice view record
https://sg.ices.dk/adviceview/AdviceList
get_catch_scenario_table(3056,2022)
get_catch_scenario_table(3056,2022)
Get Advice View Record
getAdviceViewRecord(stockcode = NULL, year = NULL, assessmentKey = NULL)
getAdviceViewRecord(stockcode = NULL, year = NULL, assessmentKey = NULL)
stockcode |
string value of the stock code you wish to look |
year |
integer value of assessment year |
assessmentKey |
integer value of SAG assessmentKey |
catch_scenario_list <- getAdviceViewRecord() head(catch_scenario_list, 3) getAdviceViewRecord("bll.27.3a47de", 2021, 15609)
catch_scenario_list <- getAdviceViewRecord() head(catch_scenario_list, 3) getAdviceViewRecord("bll.27.3a47de", 2021, 15609)
Get Catch Scenarios Notes for a given record
getCatchScenariosNotes(adviceKey)
getCatchScenariosNotes(adviceKey)
adviceKey |
advice view id(s) |
catch_scenario_note <- getCatchScenariosNotes(2814) catch_scenario_notes <- getCatchScenariosNotes(c(2814, 2815))
catch_scenario_note <- getCatchScenariosNotes(2814) catch_scenario_notes <- getCatchScenariosNotes(c(2814, 2815))
Get Catch Scenarios Table for a given record
getCatchScenariosTable(adviceKey)
getCatchScenariosTable(adviceKey)
adviceKey |
advice view id(s) |
catch_scenario_table <- getCatchScenariosTable(2814) catch_scenario_tables <- getCatchScenariosTable(c(2814, 2815))
catch_scenario_table <- getCatchScenariosTable(2814) catch_scenario_tables <- getCatchScenariosTable(c(2814, 2815))
Read a file in the ASD upload format, returning a list of metadata and data.frame
readAsdUpload(filename, format = FALSE)
readAsdUpload(filename, format = FALSE)
filename |
the file path of the file to read |
format |
should the output be formatted into an easy to read table |
filename <- system.file("CatchScenarios_AdviceKey_3207.xml", package = "icesASD") asd <- readAsdUpload(filename)
filename <- system.file("CatchScenarios_AdviceKey_3207.xml", package = "icesASD") asd <- readAsdUpload(filename)
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.
screen_asd_file(file, verbose = FALSE)
screen_asd_file(file, verbose = FALSE)
file |
file name of the file containing the data to screen |
verbose |
return verbose information about the POST request |
text message from the screening process
## Not run: # requires authorization filename <- system.file("test_files/vms_test.csv", package = "icesVMS") screen_vms_file(filename) ## End(Not run)
## Not run: # requires authorization filename <- system.file("test_files/vms_test.csv", package = "icesVMS") screen_vms_file(filename) ## End(Not run)