View source: R/pull_database.R
pull_database | R Documentation |
Extraction of
catch data,
weight measurements,
length measurements,
age reads, and
management quantities
from NORPAC and PacFIN databases for the Pacific Hake assessment.
Other, additional, databases may be added in the future through the
database =
argument.
pull_database(
database = c("NORPAC", "PacFIN"),
startyear = list(NORPAC = 2008, PacFIN = c(1980, 2008)),
endyear = hakedata_year(),
passwordfile = "password.txt",
savedir = hakedata_wd()
)
database |
A vector of character strings indicating
which databases you want to pull information from.
Options include |
startyear |
An ordered list the same length as |
endyear |
An integer value specifying the final year of data
to include in the extraction. The default uses
|
passwordfile |
A file path directing R to a file that contains
a password for each database listed in |
savedir |
A full path to a directory where you want files saved.
The default is to save them in a folder found using |
pull_database()
includes several steps, outlined below,
and leads to many files being saved to your computer.
Originally, files were NOT overwritten. In 2022, Kelli F. Johnson
changed the code to not save previous downloads to
save on disk space, reduce the storing of redundant information, and
simplify the code base that needed maintenance.
Find the folder where the data should be saved with hakedata_wd()
.
Extract data from NORPAC.
Catch data
Weight and age data
Squash table of ages (that also includes lengths)
Foreign ages
Species list
Extract data from PacFIN.
Catch data
Age, length, and weight data from bds table
At-sea data
Management quantities such as allowable catch limits (ACL) for the Pacific Fisheries Management Council, i.e., U.S. quantities of interest.
Save each object to the disk in the "extractedData" directory in
hakedata_wd()
.
An environment or list
with several objects pulled from the
NORPAC and PacFIN databases. Several Rdat
files are
saved to the disk in the extractedData folder,
one file for each object and a summary file.
Kelli F. Johnson
hakedata_year()
hakedata_wd()
## Not run:
# An environment with objects is returned
dataenv <- pull_database()
# Access individual objects using `get()`
head(get("ncatch", envir = dataenv))
# Access individual objects pretending the environment is a list
dataenv[["ncatch"]][1:5, ]
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.