This function retrieves the most recent model objects for each model name, site, year, stream, etc. You can specify model_object (the full fit object, either BUGS or stanfit, the model plot (a posterior predictive check plot), or the inputs used to fit the associated model object.

get_most_recent_model_objects(
  con,
  model_component = "model_fit",
  access_key = Sys.getenv("AZ_CONTAINER_ACCESS_KEY"),
  model_name = NULL,
  stream = NULL
)

Arguments

con

A connection object to the database.

model_component

A choice of model_fit, model_input or model_plot to pull.

model_name

Can be left empty. If provided, must be one of pcap_all, bt_spas_x, pcap_mainstem, p2s, inseason, or stock_recruit

stream

Can be left empty. If provided, must be one of battle creek, clear creek, deer creek, mill creek, feather river, butte creek, sacramento river, or yuba river.

Value

A the most recent model fit objects, inputs, or plots. The format will be a named list, where each element is named by the model_run_id, model_name, site, stream, and year.