Skip to contents

Plot QC flag results for a continuous monitoring parameter

Usage

anlzASRflag(flag, overlay = NULL, source = "A")

Arguments

flag

data frame returned by utilASRflag.

overlay

optional two-column data frame (e.g., contdat) with a DateTime column and one numeric parameter column. When supplied, the series is drawn as a light blue line on a second y-axis on the right side of the plot. Pass NULL (the default) to omit the overlay.

source

character string identifying this plot for plotly::event_data(). Defaults to "A" (plotly's own default). editASRflag sets this to a namespaced value when embedded as one step of editASRworkflow, so that multiple mounted instances don't read/write each other's click, selection, or zoom events.

Value

An interactive plotly object.

Details

Produces an interactive plotly time series showing all observations as a line, with non-passing observations overlaid as markers. Marker colour indicates which QC check fired:

  • Gross range — red

  • Spike — orange

  • Rate of change — purple

  • Flatline — blue

Marker shape indicates severity:

  • Suspect — upward triangle

  • Fail — cross (×)

An observation flagged by multiple checks appears as a marker for each check that fired, allowing all sources of concern to be visible.

See also

editASRflag, which uses this function internally to render the plot inside a Shiny app.

Examples

contpth <- system.file('extdata/ExampleCont1.xlsx', package = 'AquaSensR')
dqopth <- system.file('extdata/ExampleDQO.xlsx', package = 'AquaSensR')

contdat <- readASRcont(contpth, runchk = FALSE)
dqodat <- readASRdqo(dqopth, runchk = FALSE)

flagdat <- utilASRflag(contdat, dqodat, param = 'Water_Temp_C')
anlzASRflag(flagdat)