Prepare inputs for stock-recruit model

prepare_stock_recruit_inputs(
  con,
  stream,
  adult_data_type,
  covariate,
  truncate_dataset = FALSE
)

Arguments

con

A valid connection to the model run database.

stream

The stream for which you want to fit the model.

adult_data_type

the type of survey the adult data came from. Either passage, redd, holding, broodstock_tag, or carcass.

covariate

The covariate you would like to use to fit the model. One of rearing_max_flow, rearing_mean_flow, rearing_median_flow, rearing_min_flow, spawning_max_flow, spawning_mean_flow, spawning_median_flow, spawning_min_flow, spawning_above_13_temp_day, spawning_above_13_temp_week, spawning_gdd_spawn, spawning_weekly_max_temp_max, spawning_weekly_max_temp_mean, spawning_weekly_max_temp_median, or null.

truncate_dataset

either TRUE or FALSE. If TRUE, will filter the dataset to only include years where there are data for ALL covariates. If FALSE, will filter the dataset to include years where there are data for YOUR SELECTED covariate.

Value

a list of tables:

  • stock_recruit_table juvenile abundance and adult abundance by brood year.

  • full_covariate_table full table of covariates associated with the site, stream, and brood years in the stock recruit table

  • truncated_covariate_table table of covariates limited to only those years where all covariates are available (for covariate comparison analyses)

Details

This function prepares data for input into a stock recruit model.