Description Usage Arguments Value Note Author(s) Examples
View source: R/plot_functions.R
The stock_trends_fun
function returns a series of line plots of F and SSB relative to F<sub>MSY</sub> and MSY B<sub>trigger</sub>
reference points for stocks of a fish category for an ecoregion.
1 2 3 4 5 6 | stock_trends_fun(object, plotting_var = c("StockCode", "FisheriesGuild")[1],
grouping_var = c("EcoGuild", "EcoRegion", "FisheriesGuild")[1],
metric = c("MSY", "MEAN")[1], active_year = 2016, dynamic = FALSE,
data_caption = TRUE, file_name = NULL, save_plot = FALSE,
return_plot = TRUE, return_data = FALSE, output_path = NULL,
stackable = FALSE)
|
object |
name of data to plot. Must agree with the grouping_var argument. E.g., EcoGuild must be the combined ecoregion name and fish category, e.g. "Greater North Sea Ecoregion - demersal stocks" |
plotting_var |
character string of the variable to plot. Options include: StockCode or FisheriesGuild (mean) |
grouping_var |
character string of the desired grouping. Options include: EcoRegion, EcoGuild, or FisheriesGuild |
metric |
character string of the desired metric. Options include: MSY or MEAN (according to grouping_var) |
active_year |
numeric of the stock database version (year). e.g., 2016 |
dynamic |
logical to generate html output with dynamic features. |
data_caption |
print the data source as a caption, boolean. |
file_name |
name for the output. |
save_plot |
logical to save plot. |
return_plot |
logical to return plot to current environment. |
return_data |
logical on returning a .csv of plotted data |
output_path |
path for output to live. |
A ggplot2 object when return_plot
is TRUE
, html when dynamic
is TRUE
or .png when dynamic
is FALSE
. Output is saved as file_name
in output_path
.
When file_name
is NULL
, the file name is the ecoregion.
When output_path
is NULL
, the file is saved to "~/".
Stocks are linked to ecoregions and fish categories via the ICES Stock database. Reference points are as published in ICES Stock Assessment Graphs database. In some cases, status relative to reference points may vary from published ICES advice when reported F or SSB are very close to reference points (e.g., F = 0.201 > F<sub>MSY</sub> = 0.20).
Scott Large
1 2 3 4 | ## Not run:
stock_trends_fun(object = "Greater North Sea Ecoregion - demersal", grouping_var = "EcoGuild", return_plot = TRUE)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.