Version: | 1.2.1 |
Title: | Functions to Interact with the ICES Data Submission Utility (DATSU) |
Description: | Functions to Interact with the ICES Data Submission Utility (DATSU) https://datsu.ices.dk/web/index.aspx. |
License: | GPL-2 | GPL-3 [expanded from: GPL (≥ 2)] |
RoxygenNote: | 7.3.2 |
Suggests: | knitr, rmarkdown |
Imports: | icesConnect (≥ 1.1.4), httr, jsonlite, memoise, cachem, rlang |
Encoding: | UTF-8 |
URL: | https://datsu.ices.dk/web/index.aspx, https://github.com/ices-tools-prod/icesDatsu |
BugReports: | https://github.com/ices-tools-prod/icesDatsu/issues |
Language: | en-GB |
NeedsCompilation: | no |
Packaged: | 2025-05-02 12:30:20 UTC; colin |
Author: | Colin Millar [aut, cre], Carlos Pinto [aut], Laura Andreea Petre [aut] |
Maintainer: | Colin Millar <colin.millar@ices.dk> |
Repository: | CRAN |
Date/Publication: | 2025-05-02 14:30:18 UTC |
Build a DATSU web service url
Description
utility to build a url with optional query arguments
Usage
datsu_api(service, ...)
Arguments
service |
the name of the service |
... |
name arguments will be added as queries |
Value
a complete url as a character string
Examples
datsu_api("hi", bye = 21)
datsu_api("getDataverIDs")
get list of datasets
Description
A list of the available fields for the specified format and record (optional filter). in this list it is specified the field type, if it is mandatory and if it is linked with any vocabulary.
Usage
getDataFieldsDescription(datasetverID, recordType = NULL)
Arguments
datasetverID |
the dataset ID |
recordType |
string name of the record type, optional |
Value
List of the supported records and fields.
Examples
## Not run:
getDataFieldsDescription(145)
getDataFieldsDescription(145, "VE")
## End(Not run)
get list of datasets
Description
This API allows the user to have a list of all the datasets IDs that can be screened in the DATSU API.
Usage
getDataverIDs()
Value
The list of Datasets that can be screened in DATSU with the IDs
Examples
## Not run:
formats <- getDataverIDs()
formats[grep("vms", tolower(formats$description)), ]
## End(Not run)
get list of datasets
Description
This API allows the user to have a list of all the datasets IDs that can be screened in the DATSU API.
Usage
getListQCChecks(datasetverID, recordType = NULL)
Arguments
datasetverID |
the dataset ID |
recordType |
string name of the record type, optional |
Value
The list of Datasets that can be screened in DATSU with the IDs
Examples
## Not run:
getListQCChecks(145)
getListQCChecks(145, "VE")
## End(Not run)
get screening session list for a user
Description
This API of the web service returns a list of the sessions for the authenticated user.
Usage
getMySessionsList()
Value
The details of the users sessions
Examples
## Not run:
getMySessionsList()
## End(Not run)
get list of records for a dataset
Description
A list of the available records for the specified format
Usage
getRecordIDs(datasetverID)
Arguments
datasetverID |
the dataset ID |
Value
List of the supported records for the specified records
Examples
## Not run:
getRecordIDs(145)
## End(Not run)
get screening session details
Description
This API allows the user to view the details of a specific session.
Usage
getScreeningSessionDetails(sessionID)
Arguments
sessionID |
the session ID |
Value
Details of the session
Examples
## Not run:
getScreeningSessionDetails(10)
## End(Not run)
get screening session messages
Description
A list of the messages for the specified session ID
Usage
getScreeningSessionMessages(sessionID)
Arguments
sessionID |
the session ID |
Value
List of the messages for the specified session
Examples
## Not run:
messages <- getScreeningSessionMessages(10)
## End(Not run)
get screening session list
Description
This API allows the user to screen a file using the API
Usage
getScreeningSessionsList(dataSetVerID, year = NULL, country = NULL)
Arguments
dataSetVerID |
the dataset version id |
year |
filter by year, optional |
country |
filter by country, optional |
Value
The details of the sessions
Examples
## Not run:
getScreeningSessionsList(145)
getScreeningSessionsList(145, year = 2020)
## End(Not run)
get list of records for a dataset
Description
This API allows the user to screen a file using the API.
Usage
uploadDatsuFile(
fileToUpload,
dataSetVerID,
emailAddress = NULL,
sendEmail = TRUE,
errorLimit = 30000,
verbose = FALSE
)
Arguments
fileToUpload |
the filename of the file to upload |
dataSetVerID |
The version of the dataset |
emailAddress |
alternative email address of the user, if NULL, email address from ICES token is used |
sendEmail |
it is set to TRUE by default, this will specify if the user will to receive an email when the session is finished |
errorLimit |
does not need to be specified, it is 30000 by default |
verbose |
get verbose output from the POST request, default FALSE |
Value
The ID of the DATSU session
Examples
## Not run:
filename <- system.file("test_files/vms_test.csv", package = "icesDatsu")
id <- uploadDatsuFileFireAndForget(filename, 145)
getScreeningSessionDetails(id)
messages <- getScreeningSessionMessages(id)
head(messages)
sessionID <- uploadDatsuFile(filename, 145, sendEmail = FALSE)
messages <- getScreeningSessionMessages(sessionID)
messages
## End(Not run)
get list of records for a dataset
Description
This API allows the user to screen a file using the API.
Usage
uploadDatsuFileFireAndForget(
fileToUpload,
dataSetVerID,
emailAddress = NULL,
sendEmail = TRUE,
errorLimit = 30000,
verbose = FALSE
)
Arguments
fileToUpload |
the filename of the file to upload |
dataSetVerID |
The version of the dataset |
emailAddress |
alternative email address of the user, if NULL, email address from ICES token is used |
sendEmail |
it is set to TRUE by default, this will specify if the user will to receive an email when the session is finished |
errorLimit |
does not need to be specified, it is 30000 by default |
verbose |
get verbose output from the POST request, default FALSE |
Value
The ID of the DATSU session
Examples
## Not run:
filename <- system.file("test_files/vms_test.csv", package = "icesDatsu")
id <- uploadDatsuFileFireAndForget(filename, 145)
getScreeningSessionDetails(id)
messages <- getScreeningSessionMessages(id)
head(messages)
uploadDatsuFileFireAndForget(filename, 145, sendEmail = FALSE)
## End(Not run)