Docs(#43): compare comlandr stocksmart - #136
Conversation
…nerated resulting plot
…creating downstream files
…one for comlandr. zoom BSB y axis to remove focus on outlier year
…ted down stream files
…handle capitalization of stocksmart v 1.1.11. Also committing changes to downstream files
…nstead of landings + discard. Made downstream updates
There was a problem hiding this comment.
Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit
air
[air] reported by reviewdog 🐶
comlandr/data-raw/compare_comlandr_stocksmart.R
Lines 244 to 246 in a3c2ae4
[air] reported by reviewdog 🐶
comlandr/data-raw/compare_comlandr_stocksmart.R
Lines 252 to 254 in a3c2ae4
[air] reported by reviewdog 🐶
[air] reported by reviewdog 🐶
|
@MGrezlik the formatting error failing these checks is in a file unrelated to your work. It has been resolved elsewhere, and can be ignored. Feel free to ignore the failed checks, and proceed as usual. |
… If reviewers or anyone else wants to see them, they can run the script from data-raw
|
This all looks good. I am curious as to how you selected the 18 species (one being the skate complex). If i look at the suite of species in |
|
The current method pulls all landings from comlandr and all assessments from stocksmart. It joins the two pulls based on species common names which occur in both sets. |
andybeet
left a comment
There was a problem hiding this comment.
This works for now Max. Thanks



🐟
Justification
Issue #43 highlighted significant discrepancies between
comlandrlandings andStockSMARTtotal catch across several key species (including haddock, and black sea bass). The working hypotheses were that these gaps are driven by commercial discards, missing recreational landings, or geographic mismatches.To properly investigate this, this PR introduces a robust comparative script (
compare_comlandr_stocksmart.R) that:skate complex) and explicitly dropping foreign landings fromcomlandr.StockSMARTunits (e.g., "Thousand lbs", "kg") into Metric Tons for direct comparisons.Types of changes
What types of changes does this pull request introduce? Put an
xin the boxes that apply.This will inform the new release number.
Further comments
This script incorporates several major data-cleaning upgrades to ensure accuracy:
stocksmartv1.1.11 Compatibility: The script was updated to handle the new snake_case column names introduced in the latest major release ofstocksmart. Upgrading to this version also resolved a database truncation issue where Mid-Atlantic Black Sea Bass data prior to 1989 was missing.case_whenblock to mathematically convert regional reporting units (like SEDAR's "Thousand lbs") into Metric Tons.issue43_comlandr_overages.csvtable that calculatesLandings_Difference_mtandTotal_Difference_mtto quickly identify the worst-offending species where comlandr landings inexplicably exceed stock assessment totals.Reviewer instructions
Assign at least 2 reviewers:
To test these changes and review the outputs, please pull down the branch and execute the script:
Check the generated outputs in the data-raw/ folder:
issue43_hypothesis_test.pdf: Review the faceted plots. Note how the gap between Line 2 (Comlandr Total) and Line 3 (Stock SMART) highlights missing recreational data.issue43_catch_comparison_table.csv: The master data table mapping the exact differences.issue43_comlandr_overages.csv: A filtered table sorted to show where comlandr landings exceed assessment catch.Formatting
This repo contains an
air.tomlfile that automatically formats code to a set of standards.It is preferred that contributors and reviewers install the Air formatting tool.
Code submitted in this pull request will be automatically checked for correct formatting.