Package 'icesDatsu'

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>.
Authors: Colin Millar [aut, cre], Carlos Pinto [aut], Laura Andreea Petre [aut]
Maintainer: Colin Millar <[email protected]>
License: GPL (>= 2)
Version: 1.2.0
Built: 2024-10-25 05:28:55 UTC
Source: CRAN

Help Index


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

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)