Skip to contents

Prepares standardized model estimates for database export. Joins the catch group crosswalk (returned by resolve_catch_groups() in CreelEstimates) to attach model_catch_group_id to catch and CPUE estimate rows, joins angler type UUIDs on the stratum table, and drops local-only name/label columns to match the model_estimates_stratum and model_estimates_total schemas.

Usage

prep_export(conn, creel_estimates, catch_group_lut)

Arguments

conn

a valid DBI connection. @seealso establish_db_con()

creel_estimates

list object containing standardized model estimates returned by transform_estimates().

catch_group_lut

catch group crosswalk for the fishery, returned by resolve_catch_groups(). Must contain combined_catch_group and model_catch_group_id.

Value

creel_estimates with stratum and total tables prepared for write_stratum() and write_total().

Details

Effort rows carry no catch group; their model_catch_group_id is NA and written as NULL (the column is nullable on both tables).