| Title: | Functions to Support the ICES Transparent Assessment Framework |
|---|---|
| Description: | Functions to support the ICES Transparent Assessment Framework <https://taf.ices.dk> to organize data, methods, and results used in ICES assessments. ICES is an organization facilitating international collaboration in marine science. |
| Authors: | Colin Millar [aut, cre], Arni Magnusson [aut] |
| Maintainer: | Colin Millar <[email protected]> |
| License: | GPL-3 |
| Version: | 4.3.1 |
| Built: | 2026-05-20 07:37:08 UTC |
| Source: | https://github.com/ices-tools-prod/icesTAF |
Functions to support the ICES Transparent Assessment Framework, to organize data, methods, and results used in ICES assessments.
Colin Millar and Arni Magnusson.
ICES Transparent Assessment Framework: https://taf.ices.dk.
To explore example TAF stock assessments, see the introductory video and tutorial.
The TAF Wiki provides additional help resources.
Useful links:
Form and validate an artifact as an export from a TAF repository.
artifact(path, type = c("adhoc", "FLStock", "SAG"), ..., check = TRUE, quiet = FALSE)artifact(path, type = c("adhoc", "FLStock", "SAG"), ..., check = TRUE, quiet = FALSE)
path |
The relative path to a file to be added, e.g. "data/indices.csv". |
type |
the type of output, e.g. FLStock, SAG_upload |
... |
a list of metadata to be attributed to the entry. |
check |
logical, should the artifact be checked for validity? |
quiet |
logical, should the function be quiet? |
check.artifact write.artifacts
## Not run: sag_file <- system.file("SAG", "sol_27_4.xml", package = "icesTAF") sag <- artifact(sag_file, type = "SAG", check = FALSE) sag # to check the artifact, use: sag <- artifact(tmpfile, type = "SAG") # or check.artifact(sag) ## End(Not run)## Not run: sag_file <- system.file("SAG", "sol_27_4.xml", package = "icesTAF") sag <- artifact(sag_file, type = "SAG", check = FALSE) sag # to check the artifact, use: sag <- artifact(tmpfile, type = "SAG") # or check.artifact(sag) ## End(Not run)
Validate an artifact as an export from a TAF repository.
check.artifact(artifact, check.metadata = TRUE, check.type = TRUE, quiet = FALSE)check.artifact(artifact, check.metadata = TRUE, check.type = TRUE, quiet = FALSE)
artifact |
an artifact object made using |
check.metadata |
logical, should the metadata be checked against the ICES Vocabulary database? |
check.type |
logical, should type specific artifact checks be run? |
quiet |
logical, should the function be quiet? |
## Not run: sag_file <- system.file("SAG", "sol_27_4.xml", package = "icesTAF") sag <- artifact(sag_file, type = "SAG", check = FALSE) check.artifact(sag) ## End(Not run)## Not run: sag_file <- system.file("SAG", "sol_27_4.xml", package = "icesTAF") sag <- artifact(sag_file, type = "SAG", check = FALSE) check.artifact(sag) ## End(Not run)
Check that all data entries in boot/DATA.bib are present in the boot/data folder
check.boot.data()check.boot.data()
logical vector indicating which entries are present (TRUE) or missing (FALSE)
Get a list of TAF artifacts and their metadata, i.e., all the FLStocks, SAG upload files, RCEF files, and other files uploaded to TAF.
get.artifacts(year = NULL, stock = NULL, ...)get.artifacts(year = NULL, stock = NULL, ...)
year |
the assessment year, e.g. 2015, default all years. |
stock |
a stock name, e.g. lin.27.5a, default all stocks. |
... |
arguments passed to |
A data frame.
Colin Millar.
icesTAF-package gives an overview of the package.
## Not run: artifacts <- get.artifacts(2023) nshad_artifacts <- get.artifacts(stock = "had.27.46a20") ## End(Not run)## Not run: artifacts <- get.artifacts(2023) nshad_artifacts <- get.artifacts(stock = "had.27.46a20") ## End(Not run)
Read and validate an artifact file.
read.artifacts(file = "ARTIFACTS.json", check = TRUE)read.artifacts(file = "ARTIFACTS.json", check = TRUE)
file |
the name of the artifacts file to read |
check |
logical, should the artifact be checked for validity? |
utility to build a url with optional query arguments
taf_api(service, ...)taf_api(service, ...)
service |
the name of the service |
... |
name arguments will be added as queries |
a complete url as a character string
taf_api("hi", bye = 21) taf_api("FLStocks")taf_api("hi", bye = 21) taf_api("FLStocks")
Get a url, optionally using an ICES authentication token
taf_get(url, retry = TRUE, quiet = getOption("icesTAF.messages") %||% FALSE, verbose = FALSE, content = TRUE, use_token = getOption("icesTAF.use_token") %||% FALSE) taf_get_cached(url, retry = TRUE, quiet = getOption("icesTAF.messages") %||% FALSE, verbose = FALSE, content = TRUE, use_token = getOption("icesTAF.use_token") %||% FALSE)taf_get(url, retry = TRUE, quiet = getOption("icesTAF.messages") %||% FALSE, verbose = FALSE, content = TRUE, use_token = getOption("icesTAF.use_token") %||% FALSE) taf_get_cached(url, retry = TRUE, quiet = getOption("icesTAF.messages") %||% FALSE, verbose = FALSE, content = TRUE, use_token = getOption("icesTAF.use_token") %||% FALSE)
url |
the url to get. |
retry |
should the get request be retried if first attempt fails? default TRUE. |
quiet |
should all messages be suppressed, default FALSE. |
verbose |
should verbose output form the http request be returned? default FALSE. |
content |
should content be returned, or the full http response? default TRUE, i.e. content is returned by default. |
use_token |
should an authentication token be sent with the request? default is the value of the option icesSAG.use_token. |
content or an http response.
taf_get_cached(): cached version of taf_get
taf_api builds a SAG web service url.
icesTAF-package gives an overview of the package.
## Not run: taf_get(taf_api("FLStocks")) ## End(Not run)## Not run: taf_get(taf_api("FLStocks")) ## End(Not run)
Post to a url using an ICES authentication token
taf_post(url, body = list(), verbose = FALSE)taf_post(url, body = list(), verbose = FALSE)
url |
the url to post. |
body |
a list of named arguments to be sent as the body of the post request. |
verbose |
should verbose output from the http request be returned? default FALSE. |
content of the http response.
taf_api builds a TAF web service url.
icesTAF-package gives an overview of the package.
Create initial directories and R scripts for a new TAF analysis using a stock assessment created on stockassessment.org.
taf.skeleton.sa.org(path = ".", stockname, force = FALSE)taf.skeleton.sa.org(path = ".", stockname, force = FALSE)
path |
where to create initial directories and R scripts. The default is the current working directory. |
stockname |
The short-form name of a stock on stockassessment.org. |
force |
whether to overwrite existing scripts. |
Full path to analysis directory.
taf.skeleton creates an empty generic TAF skeleton.
icesTAF-package gives an overview of the package.
## Not run: taf.skeleton.sa.org(stockname = "WBCod_2021_cand01") ## End(Not run)## Not run: taf.skeleton.sa.org(stockname = "WBCod_2021_cand01") ## End(Not run)
Create initial directories and R scripts for a new TAF analysis using a stock assessment created on stockassessment.org.
taf.template(template = "WKTNET:simple", force = FALSE, gitignore = TRUE, path = ".")taf.template(template = "WKTNET:simple", force = FALSE, gitignore = TRUE, path = ".")
template |
which template to use. The default is "WKTNET:simple" |
force |
whether to overwrite existing scripts. |
gitignore |
whether to add a .gitignore file. |
path |
where to create initial directories and R scripts. The default is the current working directory. |
Full path to analysis directory.
taf.skeleton creates an empty generic TAF skeleton.
icesTAF-package gives an overview of the package.
## Not run: taf.template(template = "WKTNET:simple") ## End(Not run)## Not run: taf.template(template = "WKTNET:simple") ## End(Not run)
Validate and write an artifact file.
write.artifacts(..., append = TRUE, check = TRUE)write.artifacts(..., append = TRUE, check = TRUE)
... |
a list of artifact objects made using |
append |
logical, should the new artifacts be appended to the existing file? |
check |
logical, should the artifact be checked for validity? |