Script 04 is the core trend-analysis step in the workflow
- preproccesess chemistry and water-level data
- assign trend periods (TERM) using cutoffs, special rules/overrides
- model on: time only or time + river stage (with lag)
Results may be:
- a single trend summary object, or
- a list of trend summary objects when multiple TERM periods exist
Note: all R code functions/helpers used in 05_ReportFigures.R saved in ./r_function_extract
Script 05 is the reporting layer for the Tobit workflow.
Uses trend-analysis data from Script 04, water-level trend data, well metadata, and GIS base data, then produces:
- one PDF report per OU
- one page per well with summary table, map and plots
- Load trend and water-level data
- Load well metadata, GIS base layers
- Group wells by OU
- For each well, extract:
- analyte name and units
- well coordinates / OU
- whether river stage is used
- associated water-level object
- lag(s) / regression info for each TERM
- Choose one of two page templates:
pltReport(...)if trend / lag output existspltPlaceholder(...)if no regression analysis was performed
The page contains:
- header
- header summary table
- location map
- legend
- top time-series panel: observed water level + river stage
- middle panel: observed chromium concentrations + river stage
- lower-middle panel: observed + model-predicted concentrations
- bottom panel: regression summary / significance display
Uses the same upper layout:
- header
- header summary table
- location map
- legend
- optional water-level panel
- chromium observations panel
The bottom plot area is replaced with a simple No Regression Analysis Performed message.
- Chromium observations are plotted on a log scale
- Non-detects are highlighted separately (red triangle)
- Each trend TERM is shown with its own colour / symbol styling
- If water-level data exist, the top panel also shows the screened interval
- River stage is omitted for wells listed in
NoRS - Script 05 creates a report summary table for each well using
tblSummary(...)