Merge Fishing Trips Data with PDS records
merge_trips.Rd
This function merges fishing trip tracking data with landing records by matching IMEI numbers and landing dates. It only merges records where there is exactly one trip and one landing per day for a given IMEI to ensure accurate matching.
Usage
merge_trips(log_threshold = logger::DEBUG)
Details
The function performs the following steps:
Pulls preprocessed landing data from MongoDB
Retrieves deployed device metadata
Fetches trip tracking data from PDS (Pelagic Data Systems)
Validates IMEI numbers
Identifies unique trips per day
Merges landing records with tracking data
Uploads merged results back to MongoDB
Data Requirements
MongoDB connection with preprocessed landing data
Valid PDS API credentials in configuration
Deployed device metadata with IMEI numbers
Warning
This function assumes that trips ending on the same day as landings correspond to each other. This assumption may not hold if multiple trips occur on the same day.
Examples
if (FALSE) { # \dontrun{
merge_trips()
merge_trips(log_threshold = logger::INFO)
} # }