View source: R/PullCatch.PacFIN.R
PullCatch.PacFIN | R Documentation |
Pull catch data from the Comprehensive Fish Ticket table in PacFIN.
PullCatch.PacFIN(
pacfin_species_code,
council_code = "P",
username = getUserName("PacFIN"),
password = ask_password(),
savedir = getwd(),
addnominal = TRUE,
verbose = TRUE
)
pacfin_species_code |
A vector of strings specifying the PacFIN species
code(s) you are interested in. This has sometimes been referred to as
|
council_code |
A vector of character strings specifying the council code
that you wish to retain data for. The default |
username |
Most often, this is a string containing your username for the
database of interest. You can use |
password |
Most often, this is a string containing your password for
the database of interest. You can use the function |
savedir |
A file path to the directory where the results will be saved. The default is the current working directory. The path can be relative or absolute. |
addnominal |
A logical, where the default, |
verbose |
A logical specifying if output should be written to the
screen or not. Good for testing and exploring your data but can be turned
off when output indicates information that you already know. The printing
of output to the screen does not affect any of the returned objects. The
default is to always print to the screen, i.e., |
There is a rockfish (URCK) category that consists of unassigned rockfish landings. The majority of the catch is prior to 2001. Currently, there is no agreed upon methodology to parsed these landing out to specific rockfish species. At present, landings in this category are not included in species-specific rockfish catch pulls.
In PacFIN there are four species code that can be associated with Pacific ocean perch. These are POP, POP1, POP2, UPOP. The POP1 is general shelf/slope rockfish and not Pacific ocean perch specific landings. These records occur only in Oregon. As of the 2017 assessment, these records should be removed from the catch file.
Values passed to pacfin_species_code
are searched for in their exact form.
That is, there are no regular expression searches so mistakes such as
" POP"
will not be found. In my experiences these mistakes in the species
codes are more common for PacFIN species codes that are three letters rather
than the standard four letters.
A .RData
file is saved with the object inside the file stored as
catch.pacfin
. This same data frame is also returned invisibly.
Kelli F. Johnson
PullNominal.PacFIN()
determines the nominal species codes
sql_catch()
writes the sql code to pull the data
## Not run:
catch.pacfin <- PullCatch.PacFIN("PTRL")
# Check for confidentiality by year
# though you would also want to do this by your gear types
dplyr::group_by(catch.pacfin, LANDING_YEAR) %>%
dplyr::summarize(count = dplyr::n_distinct(VESSEL_ID)) %>%
dplyr::filter(count < 4)
# look for foreign landings
catch.pacfin <- PullCatch.PacFIN("PTRL", council_code = c("*", "N"))
# Counts of NROW() by area code(s)
dplyr::group_by(catch.pacfin, ORIG_PACFIN_CATCH_AREA_CODE) %>%
dplyr::count()
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.