Skip to contents

Creates an interactive scatterplot of result values by day of year for one characteristic. Results can be filtered to one monitoring location or all monitoring locations and to selected year and month ranges. Points are colored by year.

Usage

TADA_DayOfYearPlot(
  .data,
  location = "all",
  comparableDataId,
  yearRange = NULL,
  monthRange = c(1, 12)
)

Arguments

.data

TADA dataframe containing data downloaded from the WQP, where each row represents a unique data record. The dataframe must include 'ActivityStartDate', 'TADA.CharacteristicName', 'TADA.ResultMeasureValue', 'TADA.ResultMeasure.MeasureUnitCode', and either 'TADA.MonitoringLocationIdentifier' or 'MonitoringLocationIdentifier'.

location

TADA.MonitoringLocationIdentifier to plot. Defaults to 'all', which includes all monitoring locations in the input dataframe. Only one or "all" monitoring location(s) identifier can be selected.

comparableDataId

A single value from 'TADA.ComparableDataIdentifier' identifying the comparable data identifier to plot.

yearRange

A numeric vector of length two specifying the minimum and maximum years to include. Defaults to NULL, which includes all years in the filtered dataframe.

monthRange

A numeric vector of length two specifying the minimum and maximum months to include, using integers 1 through 12. Defaults to c(1, 12), which includes all months.

Value

A plotly scatterplot showing result values by day of year, with points colored by year.

Examples

# Load example dataset:
utils::data(Data_TribalNations_Harmonized)

# Plot all available years and months for one characteristic and all sites:
TADA_DayOfYearPlot(
  Data_TribalNations_Harmonized,
  comparableDataId = "TEMPERATURE_NONE_NONE_DEG C"
)
#> TADA_DayOfYearPlot: QC samples were removed before plotting.
# Plot one monitoring location over a selected year and month range: TADA_DayOfYearPlot( Data_TribalNations_Harmonized, location = "REDLAKE_WQX-LRE-C", comparableDataId = "TEMPERATURE_NONE_NONE_DEG C", yearRange = c(2021, 2025), monthRange = c(1, 10)) #> TADA_DayOfYearPlot: QC samples were removed before plotting.