Generate Complete Fleet Activity Analysis Pipeline
generate_fleet_analysis.Rd
Executes the complete fleet activity analysis pipeline from data retrieval through final aggregation and cloud storage upload. This function orchestrates all steps including metadata retrieval, trip processing, fleet estimation, and results storage.
Usage
generate_fleet_analysis(log_threshold = logger::DEBUG)
Value
Invisibly returns NULL. The function's primary purpose is to:
Generate and save aggregated analysis results to RDS file
Upload results to cloud storage
Log progress and completion status
Details
This function executes the complete analysis pipeline:
Reads configuration parameters and retrieves metadata
Prepares boat registry from metadata
Processes trip data from PDS API using device IMEIs
Downloads monthly summaries from cloud storage
Calculates monthly trip statistics from GPS data
Estimates fleet-wide activity using boat registry
Calculates district totals using catch/revenue data
Generates annual summary statistics by district
Saves aggregated results to RDS file and uploads to cloud storage
The function creates a comprehensive analysis that scales GPS-tracked boat data to estimate total fleet activity, catch, and revenue by district and time period.
Output Files
The function creates an RDS file containing a list with three components:
fleet_estimates: Monthly fleet activity estimates by district
district_totals: Monthly district-level catch and revenue totals
annual_summary: Annual summary statistics by district including:
months_with_data: Number of months with data
avg_sampling_rate: Average sampling rate across months
total_estimated_catch_kg: Total estimated annual catch
total_estimated_revenue: Total estimated annual revenue
avg_monthly_catch_kg: Average monthly catch
avg_monthly_revenue: Average monthly revenue
See also
prepare_boat_registry()
for boat registry preparationprocess_trip_data()
for trip data processingcalculate_monthly_trip_stats()
for monthly statisticsestimate_fleet_activity()
for fleet estimatescalculate_district_totals()
for final totals
Examples
if (FALSE) { # \dontrun{
# Run complete fleet analysis pipeline
generate_fleet_analysis()
# Run with different logging level
generate_fleet_analysis(log_threshold = logger::INFO)
} # }