Skip to contents

Plot observed and fitted compositions

Usage

plot_composition(
  x,
  type = c("lf", "wf"),
  fishery = NULL,
  scale = c("auto", "proportion", "density")
)

Arguments

x

A fitted opal_obj.

type

Length ("lf") or weight ("wf") compositions.

fishery

Optional fishery indices to include.

scale

Display proportions or probability densities. "auto" uses density when bin widths differ or a fishery-year has different bin schemes.

Value

A ggplot with observed points and a fitted line at actual bin midpoints. Horizontal observed and fitted segments show the bin extents. Removed and zero-size rows are excluded. Density divides both observed proportions and fitted probabilities by bin width.