Preprocess Landings Data
preprocess_landings.Rd
This function imports, preprocesses, and cleans legacy landings data from a MongoDB collection. It performs various data cleaning and transformation operations, including column renaming, removal of unnecessary columns, generation of unique identifiers, and data type conversions. The processed data is then uploaded back to MongoDB.
Usage
preprocess_landings(log_threshold = logger::DEBUG)
Value
This function does not return a value. Instead, it processes the data and uploads the result to a MongoDB collection in the pipeline database.
Details
The function performs the following main operations:
Pulls raw data from the raw data MongoDB collection.
Removes unnecessary columns and standardizes list columns.
Renames and reorganizes columns for clarity and consistency.
Generates unique 'survey_id' field.
Merges and consolidates data from various form versions.
Processes gear-specific effort data.
Handles GPS coordinates.
Converts data types and fixes nested column fields.
Recode variables and drop trailing spaces to ensure consistency and clarity.
Uploads the processed data to the preprocessed MongoDB collection.