plot_catch | R Documentation |
Functions for plotting catch data over time as a stacked bar plot.
tidy_catch(dat, areas = NULL, ...)
plot_catch(
dat,
french = FALSE,
ylab = en2fr("Catch", french),
xlim = c(1954, 2017),
units = NULL,
unreliable = c(1996, 2006),
blank_plot = FALSE
)
set_fishing_year(
dat,
month_fishing_starts = 1,
day_fishing_starts = 1,
yr_col = "year",
date_col = "best_date",
...
)
dat |
Input data frame. For |
areas |
Fisheries and Oceans major statistical areas (eg. 3C, 3D, 5A,
5B, etc.). See |
... |
Absorb unused parameters |
french |
Logical for French or English. |
ylab |
Y axis label. |
xlim |
X axis limits in years. |
units |
A named character vector with names referring to text that will
be pasted into the y-axis label and a value defining the quantity to divide
the |
unreliable |
An optional numeric vector defining years before which the
data are less reliable. Leave as |
blank_plot |
If |
month_fishing_starts |
The month in which the fishing year starts and
ends. The |
day_fishing_starts |
The day of the month in which the fishing year
starts and ends. See |
yr_col |
Name of the column in |
date_col |
Name of the column in |
tidy_catch()
Prepares PBS data for plot_catch()
. This works
across one or multiple species. * plot_catch()
Plots catch. The input data
frame must come from tidy_catch()
or have the columns (in any order):
year
, gear
, value
(containing catches or landings).
The data frame dat
with modified year data
## Not run:
d <- gfdata::get_catch("lingcod")
tidy_catch(d, areas = c("5[CDE]+", "5[AB]+", "3[CD]+")) %>%
plot_catch()
tidy_catch(d, areas = c("5A", "5B")) %>%
plot_catch()
## End(Not run)
## Not run:
d <- gfdata::get_catch("arrowtooth flounder")
d <- set_fishing_year(d, 2, 21) # Feb 21 - Feb 20 is the fishing year
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.