plot_biomass | R Documentation |
Plot biomass from MCMC output for one or more models. Includes the virgin biomass, B0
Create a plot of cohorts by age as a set of lines
Plot the relative spawning biomass with several forecast trajectories
Create a plot of exploitation fraction
Create a plot of fishing intensity
Create a plot of forecast value comparisons with the catch level on the x-axis and probability as the y axis value
Plot recruitment deviations from MCMC output for one or more models
Plot recruitment from MCMC output for one or more models
Plot relative biomass from MCMC output for one or more models
Plot recruitment from MCMC output for one or more models, relative to a particular year
Plot survey index fits from MCMC output for one or more models, for one of the acoustic surveys
plot_biomass(
model_lst = NULL,
model_names,
d_obj = NULL,
show_arrows = TRUE,
xlim = c(1964, year(Sys.time())),
x_breaks = 1966:year(Sys.time()),
x_labs_mod = 5,
x_expansion = 3,
tick_prop = 1,
vjust_x_labels = -0.25,
ylim = c(0, 4.5),
y_breaks = seq(ylim[1], ylim[2], by = 0.5),
leg_pos = c(0.65, 0.83),
leg_ncol = 1,
leg_font_size = 12,
dodge_bo = 3,
rev_colors = TRUE,
wrap_y_label = FALSE,
alpha = ts_ribbon_alpha,
point_size = ifelse(is_single_model, ts_single_model_pointsize, ts_pointsize),
point_color = ts_single_model_pointcolor,
point_shape = ifelse(is_single_model, ts_single_model_pointshape, ts_pointshape),
point_stroke = ifelse(is_single_model, ts_single_model_pointstroke, ts_pointstroke),
line_width = ifelse(is_single_model, ts_single_model_linewidth, ts_linewidth),
line_gap = ts_linegap,
single_ribbon_lines_color = ts_single_model_linecolor,
single_ribbon_fill = ts_single_model_ribbon_fill,
ribbon_line_type = ifelse(is_single_model, ts_single_model_ribbon_linetype,
ts_ribbon_linetype),
refpt_bo_linecolor = refpt_bo_linecolor,
refpt_usr_linecolor = refpt_usr_linecolor,
refpt_lrp_linecolor = refpt_lrp_linecolor,
refpt_bo_linewidth = refpt_bo_linewidth,
refpt_usr_linewidth = refpt_usr_linewidth,
refpt_lrp_linewidth = refpt_lrp_linewidth,
refpt_bo_linetype = refpt_bo_linetype,
refpt_usr_linetype = refpt_usr_linetype,
refpt_lrp_linetype = refpt_lrp_linetype
)
plot_cohort_catch(
model,
cohorts = c(1999, 2010, 2014, 2016, 2020),
ages = 0:20,
y_breaks = seq(0, 1250, 250),
leg_pos = c(0.85, 0.5),
leg_ncol = 1,
leg_font_size = 12,
axis_title_font_size = 14,
axis_tick_font_size = 11,
line_width = 1,
show_arrowheads = TRUE,
arrow_size = 0.03
)
plot_depl_fore_comparison(
model,
fore_inds = c(1, 2, model$ct_levels_vals$ct_actual_ind,
model$ct_levels_vals$ct_tac_ind, model$ct_levels_vals$ct_default_policy_ind),
xlim = c(max(forecast_yrs) - 16, max(forecast_yrs) - 1),
x_breaks = xlim[1]:xlim[length(xlim)],
x_labs_mod = 5,
show_arrows = FALSE,
x_expansion = 1,
tick_prop = 1,
vjust_x_labels = -2,
ylim = c(0, 2),
y_breaks = c(0, 0.1, 0.4, 0.5, 1, 1.5, 2),
y_labels = expression("0", "0.1B"[0], "0.4B"[0], "0.5", "B"[0], "1.5", "2"),
y_colors = c("black", "red", "green", "black", "blue", "black", "black"),
alpha = 0.2,
leg_pos = c(0.15, 0.83),
leg_ncol = 1,
leg_font_size = 12,
forecast_yrs,
point_size = ts_pointsize,
point_shape = ts_pointshape
)
plot_exploitation_fraction(
model,
show_arrows = TRUE,
xlim = c(1964, year(Sys.time()) - 1),
x_breaks = 1966:year(Sys.time()),
x_labs_mod = 5,
x_expansion = 1,
tick_prop = 1,
ylim = c(0, 0.25),
y_breaks = seq(ylim[1], ylim[2], by = 0.05),
point_size = ts_single_model_pointsize,
point_color = ts_single_model_pointcolor,
point_shape = ts_single_model_pointshape,
point_stroke = ts_single_model_pointstroke,
line_width = ts_single_model_linewidth,
line_color = ts_single_line_color
)
plot_fishing_intensity(
model,
show_arrows = TRUE,
xlim = c(1964, year(Sys.time()) - 1),
x_breaks = 1966:year(Sys.time()),
x_labs_mod = 5,
x_expansion = 1,
tick_prop = 1,
ylim = c(0, 1.4),
y_breaks = seq(ylim[1], ylim[2], by = 0.2),
point_size = ts_single_model_pointsize,
point_color = ts_single_model_pointcolor,
point_shape = ts_single_model_pointshape,
point_stroke = ts_single_model_pointstroke,
line_width = ts_single_model_linewidth,
line_color = ts_single_line_color,
fspr40_text_x = xlim[1] + 2,
fspr40_text_y = 1.05
)
plot_fore_compare(
model,
forecast_yrs,
fore_yr,
colors = c("black", "blue", "green", "orange", "red", "tan"),
shapes = c(16, 17, 17, 17, 15, 18),
x_expansion = 40,
leg_font_size = 8,
leg_pos = NULL,
leg_ncol = 1,
remove_x_val = NULL,
show_50_line = TRUE,
short = FALSE
)
plot_recdevs(
model_lst = NULL,
model_names = NULL,
d_obj = NULL,
show_arrows = TRUE,
xlim = c(1946, year(Sys.time())),
x_breaks = xlim[1]:xlim[2],
x_labs_mod = 5,
x_expansion = 2,
tick_prop = 1,
vjust_x_labels = -1,
ylim = c(-5, 5),
y_breaks = seq(ylim[1], ylim[2], by = 1),
leg_pos = c(0.65, 0.83),
leg_ncol = 1,
leg_font_size = 12,
alpha = 1,
point_color = ts_single_model_pointcolor,
point_size = ifelse(is_single_model, ts_single_model_pointsize, ts_pointsize),
point_shape = ifelse(is_single_model, ts_single_model_pointshape, ts_pointshape),
point_stroke = ifelse(is_single_model, ts_single_model_pointstroke, ts_pointstroke),
line_width = ifelse(is_single_model, ts_single_model_linewidth, ts_linewidth),
line_type = ts_single_model_linetype,
line_color = ts_single_model_linecolor,
dodge_val = 1,
rev_colors = FALSE,
...
)
plot_recruitment(
model_lst = NULL,
model_names = NULL,
show_arrows = TRUE,
inc_means = FALSE,
relative = FALSE,
xlim = c(1966, year(Sys.time())),
x_breaks = xlim[1]:xlim[2],
x_labs_mod = 5,
x_expansion = 2,
tick_prop = 1,
vjust_x_labels = -1,
ylim = c(0, 40),
y_breaks = seq(ylim[1], ylim[2], by = 10),
y_labels = y_breaks,
y_colors = rep("black", length(y_breaks)),
alpha = 0.3,
leg_pos = c(0.65, 0.83),
leg_ncol = 1,
leg_font_size = 12,
point_size = ifelse(is_single_model, ts_single_model_pointsize, ts_pointsize),
color = ts_single_model_pointcolor,
point_shape = ifelse(is_single_model, ts_single_model_pointshape, ts_pointshape),
point_stroke = ifelse(is_single_model, ts_single_model_pointstroke, ts_pointstroke),
line_width = ifelse(is_single_model, ts_single_model_linewidth, ts_linewidth),
horizontal_line_color = "darkgreen",
crossbar_width = 0,
dodge_val = 0.5,
rev_colors = TRUE,
d_obj = NULL
)
plot_rel_biomass(
model_lst = NULL,
model_names = NULL,
d_obj = NULL,
show_arrows = TRUE,
xlim = c(1966, year(Sys.time())),
x_breaks = xlim[1]:xlim[2],
x_labs_mod = 5,
x_expansion = 3,
tick_prop = 1,
vjust_x_labels = -2,
hjust_y_labels = 0,
ylim = c(0, 3.5),
y_breaks = seq(ylim[1], ylim[2], by = 0.5),
leg_pos = c(0.65, 0.83),
leg_ncol = 1,
leg_font_size = 12,
rev_colors = TRUE,
wrap_y_label = FALSE,
alpha = ts_ribbon_alpha,
point_color = ts_single_model_pointcolor,
point_size = ifelse(is_single_model, ts_single_model_pointsize, ts_pointsize),
point_shape = ifelse(is_single_model, ts_single_model_pointshape, ts_pointshape),
point_stroke = ifelse(is_single_model, ts_single_model_pointstroke, ts_pointstroke),
line_width = ifelse(is_single_model, ts_single_model_linewidth, ts_linewidth),
line_gap = ts_linegap,
single_ribbon_lines_color = ts_single_model_linecolor,
single_ribbon_fill = ts_single_model_ribbon_fill,
ribbon_line_type = ifelse(is_single_model, ts_single_model_ribbon_linetype,
ts_ribbon_linetype),
refpt_bo_linecolor = ts_refpt_bo_linecolor,
refpt_usr_linecolor = ts_refpt_usr_linecolor,
refpt_lrp_linecolor = ts_refpt_lrp_linecolor,
refpt_bo_linewidth = ts_refpt_bo_linewidth,
refpt_usr_linewidth = ts_refpt_usr_linewidth,
refpt_lrp_linewidth = ts_refpt_lrp_linewidth,
refpt_bo_linetype = ts_refpt_bo_linetype,
refpt_usr_linetype = ts_refpt_usr_linetype,
refpt_lrp_linetype = ts_refpt_lrp_linetype,
...
)
plot_rel_recruitment(
model_lst = NULL,
model_names,
rel_yr = 2010,
inc_means = FALSE,
xlim = c(1966, year(Sys.time())),
x_breaks = xlim[1]:xlim[2],
x_labs_mod = 5,
x_expansion = 3,
ylim = c(0, 1.2),
y_breaks = seq(ylim[1], ylim[2], by = 0.1),
y_labels = y_breaks,
y_colors = rep("black", length(y_breaks)),
alpha = 0.2,
leg_pos = c(0.65, 0.83),
leg_ncol = 1,
leg_font_size = 12,
axis_title_font_size = 14,
axis_tick_font_size = 11,
point_size = 1.5,
line_width = 0.5,
clip_cover = 2,
single_point_color = "black",
single_line_color = "black",
crossbar_width = 0,
dodge_val = 0.5,
rev_colors = FALSE,
d_obj = NULL
)
plot_survey_index_fits(
model,
model_lst = NULL,
model_names = NULL,
d_obj = NULL,
show_arrows = TRUE,
survey_type = c("age1", "age2"),
xlim = c(1995, 2021),
x_breaks = xlim[1]:xlim[2],
x_labs_mod = 5,
x_expansion = 3,
tick_prop = 1,
vjust_x_labels = -0.25,
ylim = c(0, 3),
y_breaks = seq(ylim[1], ylim[2], by = 0.5),
leg_pos = c(0.65, 0.83),
leg_ncol = 1,
leg_font_size = 12,
alpha = 1,
point_color = ts_single_model_pointcolor,
point_size = ifelse(is_single_model, ts_single_model_pointsize, ts_pointsize),
point_shape = ifelse(is_single_model, ts_single_model_pointshape, ts_pointshape),
line_width = ifelse(is_single_model, ts_single_model_linewidth, ts_linewidth),
line_type = ts_single_model_linetype,
line_color = ts_single_model_linecolor,
obs_point_shape = 17,
obs_point_size = point_size * 2,
obs_line_type = "dashed",
obs_line_width = 1.25,
obs_err_line_type = "solid",
obs_err_line_width = 1,
obs_color = "black",
dodge_val = 0.5,
rev_colors = FALSE,
...
)
model_lst |
A list of models, each created by |
model_names |
A vector of model names,the same length as |
d_obj |
If not |
show_arrows |
Logical. If |
xlim |
The year limits to plot |
x_breaks |
The year value tick marks to show for the x axis |
x_labs_mod |
Value for major X-axis tick marks. Every Nth tick will be longer and have a label. The first and last will be shown regardless of what this number is |
x_expansion |
Amount to expand the x axis. See the |
tick_prop |
A value that the length of the major tick marks are
multiplied by. This proportion must be set by trial and error. Make sure
to change |
vjust_x_labels |
Adjustment to move the x-axis tick labels and label up or down. Negative numbers move down |
ylim |
The y-axis minimum and maximum limits for the plot |
y_breaks |
The tick mark values to show for the y-axis |
leg_pos |
The position of the legend inside the plot. If |
leg_ncol |
The number of columns to show in the legend |
leg_font_size |
The legend font size labels |
dodge_bo |
A value to adjust the spacing between multiple B0 points and errorbars in the case of more than one model being plotted |
rev_colors |
Logical. If |
wrap_y_label |
Logical. If |
alpha |
The transparency for the ribbons (credible intervals) |
point_size |
The size of the points used for the median lines (See
|
point_color |
The R color for the points used for the median lines
(See |
point_shape |
The R shape number for the points used for the median
lines (See |
point_stroke |
The stroke value for the points used for the median
lines (See |
line_width |
Width of the median line and errorbar line (for the B0
value) (See |
line_gap |
Gap between the connecting lines and points for each line.
See the |
single_ribbon_lines_color |
Line color for the ribbon limit lines (credible interval) for the case where there is only a single model to plot |
single_ribbon_fill |
The ribbon fill color if there is only a single model |
ribbon_line_type |
Line type for ribbon edges; use 0 for no line. |
refpt_bo_linecolor |
The line color for the B0 horizontal line |
refpt_usr_linecolor |
The line color for the Upper stock reference horizontal line |
refpt_lrp_linecolor |
The line color for the Limit Reference point horizontal line |
refpt_bo_linewidth |
The line width for the B0 horizontal line |
refpt_usr_linewidth |
The line width for the Upper stock reference horizontal line |
refpt_lrp_linewidth |
The line width for the Limit Reference point horizontal line |
refpt_bo_linetype |
The line type for the B0 horizontal line |
refpt_usr_linetype |
The line type for the Upper stock reference horizontal line |
refpt_lrp_linetype |
The line type for the Limit Reference point horizontal line |
model |
A model, created by |
cohorts |
A vector of cohorts to make lines for |
ages |
A vector of ages to show |
show_arrowheads |
Logical. If |
arrow_size |
size of the arrow heads, |
fore_inds |
Indices of the |
y_labels |
Labels for the tick marks on the y-axis |
y_colors |
Colors for the tick labels on the y-axis |
forecast_yrs |
A vector of the forecast years |
fspr40_text_x |
X-axis value for the location of the FSPR=40% text |
fspr40_text_y |
Y-axis value for the location of the FSPR=40% text |
fore_yr |
The forecast year to use in the plot. Must be in
|
colors |
Colors to use for the lines in the plot |
shapes |
Shapes to use for the points in the plot. Must be the same
length as |
remove_x_val |
A vector of values to remove labels for on the x axis.
Plot first leaving this as |
show_50_line |
Logical. If |
short |
Logical. If |
dodge_val |
The amount to separate lines between unique models multiple model plots |
... |
Arguments passed to |
inc_means |
Logical. If |
relative |
Logical. If |
horizontal_line_color |
for relative plot, colour of the dashed line at 1 |
survey_type |
Either |
ax_title_font_size |
Size of the font for the X and Y axis labels |
ax_tick_font_size |
Size of the font for the X and Y axis tick labels |
ax_label_color |
Color of the font for the X and Y axis tick and title labels |
a ggplot2::ggplot()
object
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.