The Water Quality Portal (WQP) does not currently include a lot of high-frequency sensor data. However, sometimes data providers choose to aggregate their continuous data to a daily avg, max, or min value, and then submit that aggregated data to the WQP through WQX. Alternatively, some organizations aggregate their high frequency data (15 min or 1 hour data) to 2 or 4 hour interval averages, and they also submit that data to the WQP through WQX. The raw continuous time series data is made available through a text file attachment at the activity level. This type of high frequency data may (or may not) be suitable for integration with discrete water quality data for assessments. Therefore, this function uses metadata submitted by data providers to flag rows with aggregated continuous data. This is done by flagging results where the ResultDetectionConditionText = "Reported in Raw Data (attached)". When clean = FALSE and flaggedonly = FALSE, a column titled "TADA.AggregatedContinuousData.Flag" is added to the dataframe to indicate if the row includes aggregated continuous data, "Continuous", or not, "Discrete". When clean = FALSE and flaggedonly = TRUE, the dataframe will be filtered to show only the rows flagged "Continuous" for aggregated continuous data. When clean = TRUE and flaggedonly = FALSE, rows with aggregated continuous data are removed from the dataframe and no column will be appended. When clean = TRUE and flaggedonly = TRUE, the function does not execute and an error message is returned. The default is clean = TRUE and flaggedonly = FALSE.
Arguments
- .data
TADA dataframe
- clean
Boolean argument; removes aggregated continuous data from the dataframe when clean = TRUE. Default is clean = TRUE.
- flaggedonly
Boolean argument; filters dataframe to show only aggregated continuous data when flaggedonly = TRUE. Default is flaggedonly = FALSE.
Value
When clean = FALSE and flaggedonly = FALSE, a column flagging rows with aggregated continuous data is appended to the input data set. When clean = FALSE and flaggedonly = TRUE, the dataframe is filtered to show only the flagged aggregated continuous data and flag column is still appended. When clean = TRUE and flaggedonly = FALSE, aggregated continuous data is removed from the dataframe and no column is appended. The default is clean = FALSE and flaggedonly = FALSE.
Examples
# Load example dataset
data(Data_Nutrients_UT)
# Remove aggregated continuous data in dataframe:
AggContinuous_clean <- TADA_FindContinuousData(Data_Nutrients_UT, clean = TRUE)
#> [1] "No evidence of aggregated continuous data in your dataframe. Returning the input dataframe with TADA.AggregatedContinuousData.Flag column for tracking."
# Flag, but do not remove, aggregated continuous data in new column
# titled "TADA.AggregatedContinuousData.Flag":
AggContinuous_flags <- TADA_FindContinuousData(Data_Nutrients_UT, clean = FALSE)
#> [1] "No evidence of aggregated continuous data in your dataframe. Returning the input dataframe with TADA.AggregatedContinuousData.Flag column for tracking."
# Show only rows flagged for aggregated continuous data:
AggContinuous_flaggedonly <- TADA_FindContinuousData(Data_Nutrients_UT,
clean = FALSE, flaggedonly = TRUE
)
#> [1] "This dataframe is empty because we did not find any aggregated continuous data in your dataframe"