
Merge Price Data
merge_prices.RdThis function combines and processes legacy and ongoing catch price data from MongoDB collections, aggregating prices by year and uploading the results back to MongoDB.
Usage
merge_prices(log_threshold = logger::DEBUG)Details
The function performs the following main operations:
Pulls legacy price data from MongoDB and summarizes it yearly
Pulls ongoing price data from MongoDB and summarizes it yearly
Combines legacy and ongoing data
Filters data after 1990
Removes duplicate entries
Collapses the table to exactly one median price per (date, landing_site, fish_category, size) key, so the many-to-one join in
validate_landings()cannot duplicate catch rowsUploads the processed data back to MongoDB