
Create visualization plots of detection rate performance
Source:R/1.6_function_walks_detections.R
plot_detection_rates.Rd
Generates multiple plots to visualize detection performance including per-path detection rates, per-station rates, distribution of rates, and time series analysis.
Arguments
- detection_stats
List output from
calculate_detection_summaries
containing detection performance metrics.- simulation_results
Optional. List output from
simulate_fish_tracks
. If provided, creates additional time series plots. Default is NULL.
Value
A list of ggplot2 objects:
- by_path
Bar chart showing detection rate by individual path
- by_station
Bar chart showing detection rate by individual receiver
- distribution
Histogram of detection rates across all paths
- time_series
Cumulative detection rate over time (if simulation_results provided)
Returns NULL if no detection statistics are available.
Details
The function creates four types of visualizations:
Bar chart comparing detection rates across individual fish paths
Bar chart comparing detection rates across receivers
Histogram showing the distribution of detection rates
Time series plot showing how cumulative detection rates evolve during tracks
All plots include reference lines showing mean detection rates for context.
Examples
if (FALSE) {
# Calculate detection statistics
detection_stats <- calculate_detection_summaries(fish_simulation)
# Create all available plots
plots <- plot_detection_rates(detection_stats, fish_simulation)
# Display individual plots
print(plots$by_path)
print(plots$by_station)
print(plots$distribution)
print(plots$time_series)
# Create plots without time series
basic_plots <- plot_detection_rates(detection_stats)
}