Skip to contents

Completes the session analysis_lut created by generate_analysis_lut() immediately prior to export. Adds ETL-time metadata (r_session_json, data_grade), and, when a database connection is supplied, resolves project/fishery names to database UUIDs and validates the final column set against the model_analysis_lut schema.

Usage

finalize_analysis_lut(analysis_lut, resolved_params, conn = NULL)

Arguments

analysis_lut

lookup table created during the model estimation process which stores a session-specific analysis_id key and metadata about the analysis.

resolved_params

user-input parameters defined during the model estimation process.

conn

a valid DBI connection, or NULL for local export. @seealso connect_creel_db()

Value

The finalized analysis_lut, ready for write_lut() (database) or local archiving.

Details

With con = NULL (local export) the lut retains project_name and fishery_name; id resolution is deterministic and occurs whenever the session is later exported to the database.