Pair Results for Numeric Criteria Calculation (UNDER ACTIVE DEVELOPMENT)
Source:R/CriteriaComparison.R
TADA_PairForCriteriaCalc.Rd
This function pairs TADA results with results from specified characteristics from the same MonitoringLocation within a user-specified time window to facilitate the calculation of numeric criteria. The columns created by TADA_AutoClean are required to run this function. If they are not present in the data frame, the function will stop and print an error message.
Value
A TADA data frame with six additional columns added for each pairing group specified in the pairing ref.
Details
Users can provide a pairing reference file (can be created using TADA_CreatePairRef) to specify which combinations of TADA.CharacteristicName, TADA.ResultMeasure.MeasureUnit, TADA.MethodSpeciationName, and TADA.ResultSampleFractionText should be used for hardness, pH, temperature, salinity, chloride or other user-defined groups. If no ref is specified, all possible combinations for hardness, pH, temperature, salinity and chloride will be used.
Examples
AL_df <- TADA_DataRetrieval(
startDate = "2010-11-30",
endDate = "2010-12-01",
statecode = "AL"
)
#> [1] "Downloading WQP query results. This may take some time depending upon the query size."
#> $statecode
#> [1] "US:01"
#>
#> $startDate
#> [1] "2010-11-30"
#>
#> $endDate
#> [1] "2010-12-01"
#>
#> GET: https://www.waterqualitydata.us/data/Result/search?statecode=US%3A01&startDateLo=11-30-2010&startDateHi=12-01-2010&dataProfile=resultPhysChem&mimeType=csv
#> NEWS: Data does not include USGS data newer than March 11, 2024. More details:
#> https://doi-usgs.github.io/dataRetrieval/articles/Status.html
#> GET: https://www.waterqualitydata.us/data/Station/search?statecode=US%3A01&startDateLo=11-30-2010&startDateHi=12-01-2010&mimeType=csv
#> GET: https://www.waterqualitydata.us/data/Project/search?statecode=US%3A01&startDateLo=11-30-2010&startDateHi=12-01-2010&mimeType=csv
#> NEWS: Data does not include USGS data newer than March 11, 2024. More details:
#> https://doi-usgs.github.io/dataRetrieval/articles/Status.html
#> [1] "Data successfully downloaded. Running TADA_AutoClean function."
#> [1] "TADA_Autoclean: creating TADA-specific columns."
#> [1] "TADA_Autoclean: harmonizing dissolved oxygen characterisic name to DISSOLVED OXYGEN SATURATION if unit is % or % SATURATN."
#> [1] "TADA_Autoclean: handling special characters and coverting TADA.ResultMeasureValue and TADA.DetectionQuantitationLimitMeasure.MeasureValue value fields to numeric."
#> [1] "TADA_Autoclean: converting TADA.LatitudeMeasure and TADA.LongitudeMeasure fields to numeric."
#> [1] "TADA_Autoclean: harmonizing synonymous unit names (m and meters) to m."
#> [1] "TADA_Autoclean: updating deprecated (i.e. retired) characteristic names."
#> [1] "20 results in your dataset have one of the following deprecated characteristic names: Inorganic nitrogen (nitrate and nitrite); Inorganic nitrogen (nitrate and nitrite) ***retired***use Nitrate + Nitrite. These names have been substituted with the updated preferred names in the TADA.CharacteristicName field."
#> [1] "TADA_Autoclean: harmonizing result and depth units."
#> [1] "TADA_Autoclean: creating TADA.ComparableDataIdentifier field for use when generating visualizations and analyses."
#> [1] "NOTE: This version of the TADA package is designed to work with numeric data with media name: 'WATER'. TADA_AutoClean does not currently remove (filter) data with non-water media types. If desired, the user must make this specification on their own outside of package functions. Example: dplyr::filter(.data, TADA.ActivityMediaName == 'WATER')"
AL_PairRef <- TADA_PairForCriteriaCalc(AL_df)