Plots annual length or age composition data.
plot_composition(
Year = 1:nrow(obs),
obs,
fit = NULL,
plot_type = c("annual", "bubble_data", "bubble_residuals", "mean"),
N = rowSums(obs),
CAL_bins = NULL,
ages = NULL,
ind = 1:nrow(obs),
annual_ylab = "Frequency",
annual_yscale = c("proportions", "raw"),
bubble_adj = 5,
bubble_color = c("black", "white"),
fit_linewidth = 3,
fit_color = "red"
)
A vector of years.
A matrix of either length or age composition data. For lengths, rows and columns should index years and length bin, respectively. For ages, rows and columns should index years and age, respectively.
A matrix of predicted length or age composition from an assessment model. Same dimensions as obs.
Indicates which plots to create. Options include annual distributions, bubble plot of the data, and bubble plot of the residuals, and annual means.
Annual sample sizes. Vector of length nrow(obs)
.
A vector of lengths corresponding to the columns in obs
.
and fit
. Ignored for age data.
An optional vector of ages corresponding to the columns in obs
.
A numeric vector for plotting a subset of rows (which indexes year) of obs
and fit
.
Character string for y-axis label when plot_type = "annual"
.
For annual composition plots (plot_type = "annual"
), whether the raw values
("raw") or frequencies ("proportions") are plotted.
Numeric, for adjusting the relative size of bubbles in bubble plots (larger number = larger bubbles).
Colors for negative and positive residuals, respectively, for bubble plots.
Argument lwd
for fitted line.
Color of fitted line.
Plots depending on plot_type
.
plot_composition(obs = SimulatedData@CAA[1, 1:16, ])
plot_composition(obs = SimulatedData@CAA[1, , ], plot_type = "bubble_data",
ages = 0:SimulatedData@MaxAge)