This function processes raw input and calculates the key elements needed to plot the PA leaf: the HCR bounds (linear, upper, lower), axis limits, and biomass sequence for plotting ribbons. Used internally by plot_PA_leaf() but can also be called directly to inspect data.

make_PA_data(
  data,
  Blim,
  Btrigger,
  Ftarget,
  Flim,
  zone_labels = c("Critical Zone", "Cautious Zone", "Healthy Zone")
)

Arguments

data

A data frame with the following required columns:

  • year: numeric year values

  • Btrend: numeric biomass values

  • Ftrend: numeric fishing mortality values

Optional columns:

  • Blwr, Bupr: biomass uncertainty bounds

  • Flwr, Fupr: F uncertainty bounds

  • scenario: projection scenario for linetype distinction and legend

  • label_just: justification for year label ("left", "center", "right")

Blim

Biomass limit reference point

Btrigger

Biomass trigger reference point

Ftarget

Target fishing mortality

Flim

Fishing mortality limit

zone_labels

PA zone labels. Defaults may need to be modified to keep the text inside the zone (e.g., supply "Cautious" rather than "Cautious Zone"). An empty character may also be supplied if the zone is too narrow to label.

Value

A list with components: data, Bseq, leaf_linear, leaf_low, leaf_high, xhigh, yhigh