View source: R/plot-heatmap-weight-at-age.R
plot_heatmap_weight_at_age | R Documentation |
Create a weight-at-age heatmap including extrapolated years
plot_heatmap_weight_at_age(
model,
sample_size_df = NULL,
fleet = 1,
proj_line_color = "royalblue",
proj_line_width = 1,
proj_line_yr = NULL,
yrs = NULL,
cell_font_size = 4,
...
)
model |
An list of results read in from an SS model using
|
sample_size_df |
A data frame where ages are columns (and start with the letter 'a'). If the values are zero, the weight-at-age was extrapolated/interpolated. If there is a value, the weight-at-age is data |
fleet |
An integer value specifying which fleet you want plotted. Fleet -2 will plot fecundity information. Fleet -1 will plot population weight-at-age for the middle of the year. Fleet 0 will plot population weight-at-age for the beginning of the year. Positive values for fleet will link to a modelled fleet. |
proj_line_color |
Line color to separate projection years. |
proj_line_width |
Line width to separate projection years. |
yrs |
A vector of the years to include in the table. If |
cell_font_size |
Font size of the values printed in each cell of the table |
... |
Arguments passed to ' |
Produce a matrix of colors and values of weight-at-age information by year (y-axis) and age (x-axis). The plot uses output from a Stock Synthesis model.
Ages zero through the maximum age modeled in the data are shown for each year plotted. This maximum-age shown is found by removing ages that are the duplicate of the previous age, no user input is needed.
Users have many options to control what years are included in the plot.
The beginning years of data can be removed using first_yr
.
Users do not have control over what are noted as projection years, which
are all years after the end of the data included in the assessment model
up to last year included in the weight-at-age matrix.
These projection years are noted using a horizontal line but if the
demarcation is not wanted, then they can change the line width to zero.
Finally, users can calculate the colors using a range of data specified
with first_yr
and the last year of the data in the model. Then,
the resulting plot can be truncated to a specified year range using
print_yrs
. The truncation is helpful to facilitate plots that fit
on a single page or on a slide with readable values. Using this truncation,
the colors would show trends across all plots made rather than just the
truncated data.
A ggplot2::ggplot()
object
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.