Oh, boy; oh, boy! Here it is: one of the three yearly data pushes and you’re ready to see all of the new data that have been matched to other projects in OTN or one of its nodes (ACT, FACT, et al.).
What now? What’s been updated? Who might I contact for more
information? Well, make_receiver_summary and
make_tag_summary are here to help.
The first thing you’ll want to do is gather up your OTN matched detections or detection extract files.
We’ll use data from Trudel 2018 (https://members.oceantrack.org/data/repository/pbsm) to show how this might work. First, we’ll download the files.
# Create a folder in your temporary directory to hold the sample files
td <- file.path(tempdir(), "otndo_test_files")
dir.create(td)
# Download deployment metadata
download.file(
paste0(
"https://members.oceantrack.org/data/repository/pbsm/",
"data-and-metadata/2018/pbsm-instrument-deployment-short-form-2018.xls/",
"@@download/file"
),
destfile = file.path(td, "pbsm-instrument-deployment-short-form-2018.xls"),
# Note "mode = 'wb' is needed to download Excel files
mode = "wb"
)
# Download qualified detections
download.file(
paste0(
"https://members.oceantrack.org/data/repository/pbsm/",
"detection-extracts/pbsm_qualified_detections_2018.zip/@@download/file"
),
destfile = file.path(td, "pbsm_qualified_detections_2018.zip")
)
# Download unqualified detections
download.file(
paste0(
"https://members.oceantrack.org/data/repository/pbsm/",
"detection-extracts/pbsm_unqualified_detections_2018.zip/@@download/file"
),
destfile = file.path(td, "pbsm_unqualified_detections_2018.zip")
)Now, just note where the files are saved. This will make it easier to pass into the smmary functions later.
qualified_otn <- file.path(td, "pbsm_qualified_detections_2018.zip")
unqualified_otn <- file.path(td, "pbsm_unqualified_detections_2018.zip")
deployment_otn <- file.path(
td,
"pbsm-instrument-deployment-short-form-2018.xls"
)We can do the same for matched detections:
If you’re a member of network that uses OTN’s Content Management
System (OTN, ACT, ATAP, iTAG, MigraMar, NEP, N-PAcT, and PIRAT), you can
access your files via the otndata package. Two
functions in otndata wrap otndo’s
make_*_summary functions and will automatically download
the necessary files for you. See the otndata
vignette on the topic for more details.
At the time of this writing, there is no streamlined way to get data
from these respective networks into otndo. Before moving on
to the next steps, make sure you have the necessary files
downloaded.
The summary functions conduct a bit of data cleaning on the front end and then run everything through a Quarto or RMarkdown template report. The functions use Quarto by default, but RMarkdown will be selected if:
rmd argument is set to TRUE.# Compiles with Quarto (default)
make_receiver_summary(
qualified = qualified_otn,
unqualified = unqualified_otn,
deployment = deployment_otn,
rmd = F
)
# Compiles with RMarkdown
make_receiver_summary(
qualified = qualified_otn,
unqualified = unqualified_otn,
deployment = deployment_otn,
rmd = T
)Functionality is identical for make_tag_summary:
Usually we want to know what has changed since the OTN nodes crossed
over and talked to each other (a “data push”). This is usually when we
get within-node detections, as well. These are nominally scheduled for
February, July, and October. Crossover dates are stored within
otndo; the package is updated with new dates when a data
push occurs.
You can also provide a date to the “since” argument to see a summary of all of the data that have been updated since that date.
I am always open to suggestions on what could be added to change to make this more useful for you. Please open an issue on GitHub or email me with your thoughts.
Trudel, Marc. “A Pilot Study to Investigate the Migration of Atlantic Salmon Post-Smolts and Their Interactions with Aquaculture in Passamaquoddy Bay, New Brunswick, Canada.” Ocean Tracking Network, 2018. https://members.oceantrack.org/project?ccode=PBSM.