| 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 |
Set the OTN Plone instance with which you wish to interact.
.otn_server_url( network = c("otn", "act", "atap", "itag", "migramar", "nep", "npact", "pirat", "otn_devel", "etn", "fact", "glatos", "path", "raft"), set = TRUE ).otn_server_url( network = c("otn", "act", "atap", "itag", "migramar", "nep", "npact", "pirat", "otn_devel", "etn", "fact", "glatos", "path", "raft"), set = TRUE )
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? |
Either files or url must be provided. If files is provided, files in
the data.frame are downloaded in parallel.
otn_download(files = NULL, urls = NULL, outdir = ".")otn_download(files = NULL, urls = NULL, outdir = ".")
files |
a data.frame returned by by |
urls |
The URL of the file as returned by |
outdir |
The output directory (where you want the file to be saved). Defaults to the current working directory. |
Silently returns a vector of file locations.
#' @seealso
Plone REST API documentation:
This function recursively lists files in the Detection Extracts section of your project.
otn_extract_files( project, text = NULL, since = NULL, batch_size = 25, network = NULL )otn_extract_files( project, text = NULL, since = NULL, batch_size = 25, network = NULL )
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. |
Retrieve OTN contact list.
otn_list_contacts(network = NULL)otn_list_contacts(network = NULL)
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.
otn_list_countries(network = NULL)otn_list_countries(network = NULL)
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.
otn_list_institutions(network = NULL)otn_list_institutions(network = NULL)
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.
otn_list_projects(what = c("all", "mine"), network = NULL)otn_list_projects(what = c("all", "mine"), network = NULL)
what |
Which projects do you wish to see: |
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.
otn_list_species(network = NULL)otn_list_species(network = NULL)
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.
otn_list_stats(network = NULL)otn_list_stats(network = NULL)
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. |
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.
otn_login(network = NULL)otn_login(network = NULL)
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. |
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.
Plone REST API documentation:
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.
otn_project_files( project, text = NULL, since = NULL, batch_size = 25, network = NULL )otn_project_files( project, text = NULL, since = NULL, batch_size = 25, network = NULL )
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. |
Create summary reports of receiver project data from the OTN data push.
otn_receiver_summary( project = NULL, qualified = NULL, unqualified = NULL, deployment = NULL, network = NULL, ... )otn_receiver_summary( project = NULL, qualified = NULL, unqualified = NULL, deployment = NULL, network = NULL, ... )
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 |
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.
This function creates an HTML report that can be viewed in your web browser.
## 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)## 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.
otn_search_code(code, network = NULL)otn_search_code(code, network = NULL)
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.
otn_search_contact(contact, network = NULL)otn_search_contact(contact, network = NULL)
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.
otn_search_country(country, network = NULL)otn_search_country(country, network = NULL)
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.
otn_search_institution(institution, network = NULL)otn_search_institution(institution, network = NULL)
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.
otn_search_node(node, network = NULL)otn_search_node(node, network = NULL)
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
otn_search_species(species, network = NULL)otn_search_species(species, network = NULL)
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. |
.Renviron file for repeated use.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!
otn_set_credentials(network, temporary = FALSE, overwrite = FALSE)otn_set_credentials(network, temporary = FALSE, overwrite = FALSE)
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? |
## Not run: otn_set_credentials("act") ## End(Not run) # Yup, that's it!## 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.
otn_tag_summary(project = NULL, matched = NULL, network = NULL, ...)otn_tag_summary(project = NULL, matched = NULL, network = NULL, ...)
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 |
## 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)## 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
otn_upload(file_path, project, network = NULL)otn_upload(file_path, project, network = NULL)
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. |
Silently returns a vector of file locations.
Plone REST API documentation: