Skip to contents

At present the FRAM databases use a differents stock_id numbering system in the BackwardsFRAM table than everywhere else. The dataframe `bk_lookup_chin` provides a lookup table based on the stocks used in Preseason 2024. However, we are working to modify FRAM to support splitting Chinook stock aggregates, which will lead to increased numbers of StockIDs. `bk_lookupfun_chin` provides an appropruate lookup table based on the `max_stock` argument, either returning `bk_lookup_chin` (if max_stock is not provided or doesn't exceed the stocks in `bk_lookup_chin`) or extending the dataframe with new stock ids based on the numbering conventions of the bk_stock_id.

Usage

bk_lookupfun_chin(max_stock = NA)

Arguments

max_stock

Positive integer representing the largest *Normal* stock id (stock ids outside of the BackwardsFram table). As of Preseason 2024, there are 78 stocks; splitting stocks might increase this (e.g. 80, 82, 84). Defaults to NA.

Value

Tibble of lookup table. `$stock_name_bk` gives numan-readable stock names; `$bk_stock_id` gives the "StockID" used in backwards FRAM; `$stock_id` gives the StockID used everywhere else. NAs in `$stock_id` correspond to "totalled" stocks, which are used in backwards FRAM and nowhere else.

Examples

temp = bk_lookupfun_chin(80)
tail(temp)
#> # A tibble: 6 × 3
#>   stock_name_bk                     bk_stock_id stock_id
#>   <chr>                                   <dbl>    <dbl>
#> 1 OR Mid Coast Fall                         114       NA
#> 2 -----  UnMarked OR Mid Coast Fall         115       77
#> 3 -----  Marked OR Mid Coast Fall           116       78
#> 4 New _total_ stock (bkFRAM-only)           117       NA
#> 5 New stock (presumed UnMarked)             118       79
#> 6 New stock (presumed Marked)               119       80