Description Usage Arguments Value Author(s) Examples

View source: R/report_auxiliary.R

Plots annual length or age composition data.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | ```
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"
)
``` |

`Year` |
A vector of years. |

`obs` |
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. |

`fit` |
A matrix of predicted length or age composition from an assessment model. Same dimensions as obs. |

`plot_type` |
Indicates which plots to create. Options include annual distributions, bubble plot of the data, and bubble plot of the residuals, and annual means. |

`N` |
Annual sample sizes. Vector of length |

`CAL_bins` |
A vector of lengths corresponding to the columns in |

`ages` |
An optional vector of ages corresponding to the columns in |

`ind` |
A numeric vector for plotting a subset of rows (which indexes year) of |

`annual_ylab` |
Character string for y-axis label when |

`annual_yscale` |
For annual composition plots ( |

`bubble_adj` |
Numeric, for adjusting the relative size of bubbles in bubble plots (larger number = larger bubbles). |

`bubble_color` |
Colors for negative and positive residuals, respectively, for bubble plots. |

`fit_linewidth` |
Argument |

`fit_color` |
Color of fitted line. |

Plots depending on `plot_type`

.

Q. Huynh

1 2 3 4 5 6 7 | ```
data(Red_snapper)
plot_composition(obs = Red_snapper@CAA[1, , ], plot_type = "annual")
plot_composition(obs = Red_snapper@CAA[1, , ], plot_type = "bubble_data")
plot_composition(obs = Red_snapper@CAL[1, , ], plot_type = "annual", Red_snapper@CAL_bins[1:43])
plot_composition(obs = Red_snapper@CAL[1, , ], plot_type = "bubble_data",
CAL_bins = Red_snapper@CAL_bins[1:43])
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.