Package 'otndata'

Title: Access Acoustic Telemetry Data on Plone Content Management Systems
Description: An R API to interface with the Plone REST API of Ocean Tracking Network (OTN)-affiliated data portals.
Authors: Michael O'Brien [aut, cre] (ORCID: <https://orcid.org/0000-0003-1420-6395>)
Maintainer: Michael O'Brien <[email protected]>
License: MIT
Version: 0.0.0.9000
Built: 2026-10-28 23:30:26 UTC
Source: https://github.com/trackyverse/otndata

Help Index


Set the OTN Plone instance with which you wish to interact.

Description

Set the OTN Plone instance with which you wish to interact.

Usage

.otn_server_url(
  network = c("otn", "act", "atap", "itag", "migramar", "nep", "npact", "pirat",
    "otn_devel", "etn", "fact", "glatos", "path", "raft"),
  set = TRUE
)

Arguments

network

Character. Lowercase code of the desired telemetry network. One of "otn", "act", "atap", "itag", "migramar", "nep", "npact", "pirat", or "otn_devel" (the OTN development server). Note that "etn", "fact", "glatos", "path" and "raft" are accepted, but only to produce an error and redirect you.

set

Set the network in the current session?


Download file(s) from an OTN-style Plone server.

Description

Either files or url must be provided. If files is provided, files in the data.frame are downloaded in parallel.

Usage

otn_download(files = NULL, urls = NULL, outdir = ".")

Arguments

files

a data.frame returned by by otn_project_files or otn_extract_files. Can have been filtered or edited, but must have columns of "url" and "network".

urls

The URL of the file as returned by otn_project_files or otn_extract_files

outdir

The output directory (where you want the file to be saved). Defaults to the current working directory.

Value

Silently returns a vector of file locations.

#' @seealso


List OTN extract files.

Description

This function recursively lists files in the Detection Extracts section of your project.

Usage

otn_extract_files(
  project,
  text = NULL,
  since = NULL,
  batch_size = 25,
  network = NULL
)

Arguments

project

Character. The project code.

text

Character. Text to search for in the file name/title. See Details for more information.

since

Character. Filter for files modified since this date (YYYY-MM-DD format).

batch_size

Numeric. The number of results to return. Defaults to 25.

network

Character. Lowercase code of the desired telemetry network. One of "otn", "act", "atap", "itag", "migramar", "nep", "npact", "pirat", or "otn_devel" (the OTN development server). Note that "etn", "fact", "glatos", "path" and "raft" are accepted, but only to produce an error and redirect you.

See Also

.otn_files


Retrieve OTN contact list.

Description

Retrieve OTN contact list.

Usage

otn_list_contacts(network = NULL)

Arguments

network

Character. Lowercase code of the desired telemetry network. One of "otn", "act", "atap", "itag", "migramar", "nep", "npact", "pirat", or "otn_devel" (the OTN development server). Note that "etn", "fact", "glatos", "path" and "raft" are accepted, but only to produce an error and redirect you.


Retrieve OTN country list.

Description

Retrieve OTN country list.

Usage

otn_list_countries(network = NULL)

Arguments

network

Character. Lowercase code of the desired telemetry network. One of "otn", "act", "atap", "itag", "migramar", "nep", "npact", "pirat", or "otn_devel" (the OTN development server). Note that "etn", "fact", "glatos", "path" and "raft" are accepted, but only to produce an error and redirect you.


Retrieve OTN institution list.

Description

Retrieve OTN institution list.

Usage

otn_list_institutions(network = NULL)

Arguments

network

Character. Lowercase code of the desired telemetry network. One of "otn", "act", "atap", "itag", "migramar", "nep", "npact", "pirat", or "otn_devel" (the OTN development server). Note that "etn", "fact", "glatos", "path" and "raft" are accepted, but only to produce an error and redirect you.


Retrieve OTN project list.

Description

Retrieve OTN project list.

Usage

otn_list_projects(what = c("all", "mine"), network = NULL)

Arguments

what

Which projects do you wish to see: all or mine? all can be viewed without logging in, but you must log in before viewing yours (well, mine).

network

Character. Lowercase code of the desired telemetry network. One of "otn", "act", "atap", "itag", "migramar", "nep", "npact", "pirat", or "otn_devel" (the OTN development server). Note that "etn", "fact", "glatos", "path" and "raft" are accepted, but only to produce an error and redirect you.


Retrieve OTN species list.

Description

Retrieve OTN species list.

Usage

otn_list_species(network = NULL)

Arguments

network

Character. Lowercase code of the desired telemetry network. One of "otn", "act", "atap", "itag", "migramar", "nep", "npact", "pirat", or "otn_devel" (the OTN development server). Note that "etn", "fact", "glatos", "path" and "raft" are accepted, but only to produce an error and redirect you.


Retrieve OTN network statistics.

Description

Retrieve OTN network statistics.

Usage

otn_list_stats(network = NULL)

Arguments

network

Character. Lowercase code of the desired telemetry network. One of "otn", "act", "atap", "itag", "migramar", "nep", "npact", "pirat", or "otn_devel" (the OTN development server). Note that "etn", "fact", "glatos", "path" and "raft" are accepted, but only to produce an error and redirect you.


Authenticate to an Ocean Tracking Network server.

Description

This function prompts you for the username and password associated with your OTN account. This is necessary so that you may interface with any project-specific files.

Usage

otn_login(network = NULL)

Arguments

network

Character. Lowercase code of the desired telemetry network. One of "otn", "act", "atap", "itag", "migramar", "nep", "npact", "pirat", or "otn_devel" (the OTN development server). Note that "etn", "fact", "glatos", "path" and "raft" are accepted, but only to produce an error and redirect you.

Details

A pop up will appear asking for your username and password. If everything works out, a token is written to the "SESSION_TOKEN" variable in the otn_global environment. Your username/password will not be saved – this was done intentionally so that you don't accidentally save credentials in a public script.

See Also


List OTN project files.

Description

This function lists the file names, types, upload date, and URLs of OTN project files – basically everything you see in the Data and Metadata section of your project page. You will be prompted to log in if it is not a public project.

Usage

otn_project_files(
  project,
  text = NULL,
  since = NULL,
  batch_size = 25,
  network = NULL
)

Arguments

project

Character. The project code.

text

Character. Text to search for in the file name/title. See Details for more information.

since

Character. Filter for files modified since this date (YYYY-MM-DD format).

batch_size

Numeric. The number of results to return. Defaults to 25.

network

Character. Lowercase code of the desired telemetry network. One of "otn", "act", "atap", "itag", "migramar", "nep", "npact", "pirat", or "otn_devel" (the OTN development server). Note that "etn", "fact", "glatos", "path" and "raft" are accepted, but only to produce an error and redirect you.

See Also

.otn_files


Create summary reports of receiver project data from the OTN data push.

Description

Create summary reports of receiver project data from the OTN data push.

Usage

otn_receiver_summary(
  project = NULL,
  qualified = NULL,
  unqualified = NULL,
  deployment = NULL,
  network = NULL,
  ...
)

Arguments

project

Character. The project code.

qualified, unqualified

Default is NULL: OTN qualified or unqualified detections in parquet format will be downloaded from the data server. This argument also accepts a character vector of file paths of your qualified/unqualified detections if you do not wish to download your files or your node does not use an OTN-style Plone CMS.

deployment

File path of user-supplied master OTN receiver deployment metadata.

network

Character. Lowercase code of the desired telemetry network. One of "otn", "act", "atap", "itag", "migramar", "nep", "npact", "pirat", or "otn_devel" (the OTN development server). Note that "etn", "fact", "glatos", "path" and "raft" are accepted, but only to produce an error and redirect you.

...

Arguments passed to otndo::make_receiver_push_summary

No files provided

If you only provide your project code and leave all of the arguments as their defaults, this function will ask you to log in then proceed to download all of the necessary files. You can speed up this process substantially by providing already-downloaded files.

Output

This function creates an HTML report that can be viewed in your web browser.

Examples

## Not run: 
# Using only the project code:
otn_receiver_summary("tailwinds")

# Providing a local file:
otn_receiver_summary("tailwinds", deployment = "my_master_deployment_metadata.xlsx")

# Get a summary fo what has changed since a particular date:
otn_receiver_summary("tailwinds", since = "2022-05-01")

## End(Not run)

Search OTN database by project code.

Description

Search OTN database by project code.

Usage

otn_search_code(code, network = NULL)

Arguments

code

Character. Project code for which to search. Supports partial matching.

network

Character. Lowercase code of the desired telemetry network. One of "otn", "act", "atap", "itag", "migramar", "nep", "npact", "pirat", or "otn_devel" (the OTN development server). Note that "etn", "fact", "glatos", "path" and "raft" are accepted, but only to produce an error and redirect you.


Search OTN database by project contact.

Description

Search OTN database by project contact.

Usage

otn_search_contact(contact, network = NULL)

Arguments

contact

Character. Project contact for which to search. DOES NOT support partial matching.

network

Character. Lowercase code of the desired telemetry network. One of "otn", "act", "atap", "itag", "migramar", "nep", "npact", "pirat", or "otn_devel" (the OTN development server). Note that "etn", "fact", "glatos", "path" and "raft" are accepted, but only to produce an error and redirect you.


Search OTN database by project country.

Description

Search OTN database by project country.

Usage

otn_search_country(country, network = NULL)

Arguments

country

Character. Project country for which to search. DOES NOT support partial matching.

network

Character. Lowercase code of the desired telemetry network. One of "otn", "act", "atap", "itag", "migramar", "nep", "npact", "pirat", or "otn_devel" (the OTN development server). Note that "etn", "fact", "glatos", "path" and "raft" are accepted, but only to produce an error and redirect you.


Search OTN database by institution.

Description

Search OTN database by institution.

Usage

otn_search_institution(institution, network = NULL)

Arguments

institution

Character. Institution for which to search. DOES NOT support partial matching.

network

Character. Lowercase code of the desired telemetry network. One of "otn", "act", "atap", "itag", "migramar", "nep", "npact", "pirat", or "otn_devel" (the OTN development server). Note that "etn", "fact", "glatos", "path" and "raft" are accepted, but only to produce an error and redirect you.


Search OTN database by local node.

Description

Search OTN database by local node.

Usage

otn_search_node(node, network = NULL)

Arguments

node

Character. OTN node for which to search. DOES NOT support partial matching.

network

Character. Lowercase code of the desired telemetry network. One of "otn", "act", "atap", "itag", "migramar", "nep", "npact", "pirat", or "otn_devel" (the OTN development server). Note that "etn", "fact", "glatos", "path" and "raft" are accepted, but only to produce an error and redirect you.


Search OTN database by project species

Description

Search OTN database by project species

Usage

otn_search_species(species, network = NULL)

Arguments

species

Character. Project species for which to search. DOES NOT support partial matching and only recognizes scientific names of the form "Genus species" (note capitalization).

network

Character. Lowercase code of the desired telemetry network. One of "otn", "act", "atap", "itag", "migramar", "nep", "npact", "pirat", or "otn_devel" (the OTN development server). Note that "etn", "fact", "glatos", "path" and "raft" are accepted, but only to produce an error and redirect you.


Installs your OTN username and password in your .Renviron file for repeated use.

Description

This code was adapted from tidycensus::census_api_key. Note that this saves your credentials in your .Renviron, meaning that anyone who is using your computer can theoretically access your username and password. So... use this carefully!

Usage

otn_set_credentials(network, temporary = FALSE, overwrite = FALSE)

Arguments

network

Character. Lowercase code of the desired telemetry network. One of "otn", "act", "atap", "itag", "migramar", "nep", "npact", "pirat", or "otn_devel" (the OTN development server). Note that "etn", "fact", "glatos", "path" and "raft" are accepted, but only to produce an error and redirect you.

temporary

Logical. Scrub credentials after the current session?

overwrite

Logical. Overwrite previously-stored credentials?

Examples

## Not run: 
otn_set_credentials("act")

## End(Not run)
# Yup, that's it!

Create summary reports of receiver project data from the OTN data push.

Description

Create summary reports of receiver project data from the OTN data push.

Usage

otn_tag_summary(project = NULL, matched = NULL, network = NULL, ...)

Arguments

project

Project name that you wish to have summarized

matched

Default is NULL: OTN matched detections in parquet format will be downloaded from the data server. If you do not wish to download your files or your node does not use an OTN-style Plone CMS, this argument also accepts a character vector of file paths of your matched detections. These can be parquet, CSVs, or zipped folders.

network

Character. Lowercase code of the desired telemetry network. One of "otn", "act", "atap", "itag", "migramar", "nep", "npact", "pirat", or "otn_devel" (the OTN development server). Note that "etn", "fact", "glatos", "path" and "raft" are accepted, but only to produce an error and redirect you.

...

Arguments passed to otndo::make_tag_push_summary

Examples

## Not run: 
# You can just use your project name
otn_tag_summary("mdwea")

# Or provide an optional date to summarize "What's New".
otn_tag_summary("mdwea", since = "2025-11-01")

## End(Not run)

Upload a file to the Plone CMS

Description

Upload a file to the Plone CMS

Usage

otn_upload(file_path, project, network = NULL)

Arguments

file_path

Character. Location of the file to be uploaded.

project

Character. The project code.

network

Character. Lowercase code of the desired telemetry network. One of "otn", "act", "atap", "itag", "migramar", "nep", "npact", "pirat", or "otn_devel" (the OTN development server). Note that "etn", "fact", "glatos", "path" and "raft" are accepted, but only to produce an error and redirect you.

Value

Silently returns a vector of file locations.

See Also