Skip to contents

Compare a survey timeseries numbers- and biomass- at age to visualize cohorts and compare trends over time. Because abundances can vary greatly over time, abundances are presented as the square-root transform of numbers and biomass values. These plots are taken from work done by Cole Monnahan (cole.monnahan@noaa.gov) and Dave McGowan (david.mcgowan@noaa.gov). You should input biomass values in KG and numbers as numbers of individuals! They will be summarized and plotted as biomass (1000s t) and numbers (millions) as these units work well for our typical pollock surveys.

Usage

plot_historical_age_comps_bubbleplot(
  survey_year_vector,
  age_vector,
  numbers_vector,
  biomass_vector,
  max_age = 12
)

Arguments

survey_year_vector

A vector identifying the year a given numbers or abundance value is from. This vector must be equal in length to age_vector, biomass_vector, and numbers_vector.

age_vector

A vector of fish ages (units are assumed to be years). This vector must be equal in length to survey_year_vector, biomass_vector, and numbers_vector.

numbers_vector

A vector of fish numbers (units are expected as individual fish.) This vector must be equal in length to survey_year_vector, age_vector, and biomass_vector.

biomass_vector

A vector of fish weights (units are expected as KG.) This vector must be equal in length to survey_year_vector, age_vector, and numbers_vector.

max_age

Any years >= than this age will be grouped for plotting, and presented as a 'plus' category. Defaults to 12, as this is consistent with how we generally present pollock age values.

Value

A base r plot.

Examples

if (FALSE) { # \dontrun{
# simulate some fish populations
years <- rep(c(2013,2015, 2017, 2019, 2021), 100000/5)
ages <- round(rpois(n = 100000, lambda = seq(1,6,1)), digits = 0) + 1
numbers <- sample(seq(0, 3e6, 100), size = 100000, replace = TRUE)
weights <- (ages^3 * .005) * numbers

#plot it
plot_historical_age_comps_bubbleplot(survey_year_vector = years,
age_vector = ages,
numbers_vector = numbers,
biomass_vector = weights)

#plot with a higher maximum age grouping
plot_historical_age_comps_bubbleplot(survey_year_vector = years,
 age_vector = ages,
 numbers_vector = numbers,
 biomass_vector = weights,
 max_age = 14)
} # }