Skip to contents

Batch-generate IBI reports and data exports from autosave files without running the Shiny application. This is useful for programmatic report generation and automation.

Usage

generate_reports(
  autosave_file = "all",
  output_type = "all",
  output_path = getwd(),
  autosave_path = NULL,
  metric_autosave_path = NULL
)

Arguments

autosave_file

Character. Either the filename of a specific autosave file (e.g., "autosave_MyWetland.rds"), or "all" to process all available autosave files. Defaults to "all".

output_type

Character. The type of output to generate. One of:

  • "metrics" - Metric scores as CSV

  • "raw_data" - Raw taxa data as CSV

  • "pdf_report" - Full PDF report

  • "pdf_summary" - Data summary PDF

  • "all" - Generate all output types

Defaults to "all".

output_path

Character. Directory path where output files will be saved. The directory will be created if it does not exist. Defaults to the current working directory.

autosave_path

Character. Path to the directory containing autosave files. Defaults to the package's autosave directory.

metric_autosave_path

Character. Path to the directory containing metric autosave files used to build the comparison pool for report boxplots. Defaults to the package's metric autosave directory.

Value

A data frame with columns:

  • autosave_file - Name of the processed autosave file

  • output_type - Type of output generated

  • output_file - Path to the generated file

  • success - Logical indicating whether generation succeeded

  • message - Status or error message

Examples

if (FALSE) { # \dontrun{
# Generate all outputs for all autosave files
generate_reports()

# Generate only PDF reports for a specific file
generate_reports(
  autosave_file = "autosave_MyWetland.rds",
  output_type = "pdf_report",
  output_path = "~/reports"
)

# Generate CSV exports for all files
generate_reports(output_type = "metrics", output_path = "~/exports")
} # }