This function performs a multi‑stage cleaning, filtering, and summarization of sound manifest data. It removes anomalous recordings, filters based on duration and start‑time frequency, writes the cleaned manifest to an Excel file, and generates summary tables and visual summaries for each recording group.

MakeSummaryTables(manifest_file, output_dir, workpath_root)

Arguments

manifest_file

A data frame containing the initial sound manifest created by CreateManifest(), including at least the columns fileLength.min, startTime.hhmm, group, plot, date.mmdd, area, and year.

output_dir

Path to the Excel file to be written (cleaned manifest).

workpath_root

Directory where summary PNGs and the combined PDF will be written.

Value

Invisibly returns a list with components:

  • df1 Filtered dataset after removing long recordings.

  • df2 Dataset filtered by deviation from mean duration.

  • df3 Dataset filtered by start‑time frequency.

  • summary_table Wide summary table of counts by group/plot/date.

Details

The processing steps are:

  1. Remove rows where fileLength.min > 70.

  2. Remove rows whose fileLength.min deviates by more than 5% from the mean duration.

  3. Remove rows whose startTime.hhmm occurs in fewer than 5% of the rows in the reference dataset.

  4. Write the cleaned manifest (df3) to an Excel file.

  5. Create a wide summary table of counts per group/plot/date.

  6. Generate PNG summary tables for each group and combine them into a single PDF.

Progress bars and step messages are printed using the cli package.

Examples

if (FALSE) { # \dontrun{
MakeSummaryTables(manifest_file = sound_manifest,
                       output_dir = "cleaned_manifest.xlsx",
                       workpath_root = "output/")
} # }