diff --git a/R/CriteriaComparison.R b/R/CriteriaComparison.R index bd45d1f4..4d6474cb 100644 --- a/R/CriteriaComparison.R +++ b/R/CriteriaComparison.R @@ -151,19 +151,23 @@ TADA_CreatePairRef <- function(.data, ph = TRUE, hardness = TRUE, temp = TRUE, #' Pair Results for Numeric Criteria Calculation #' -#' This function pairs TADA results with hardness, pH, and temperature results from the same -#' MonitoringLocation within an 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. +#' 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. #' #' Users can provide a pairing reference file (can be created using TADA_CreatePairRef) to specify #' which combinations of TADA.CharacteristicName, TADA.ResultMeasure.MeasureUnit, -#' TADA.MethodSpeciatioName, and TADA.ResultSampleFraction should be used for hardness, pH, and temperature. -#' If no ref is specified, all possible combinations for hardness, pH, or temperature will be used. +#' TADA.MethodSpeciatioName, and TADA.ResultSampleFraction 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. #' #' @param .data TADA dataframe #' #' @param ref Write description of what columns need to be in this ref or null option +#' +#' @param hours_range Numeric argument. The time difference allowed between the paired characteristic +#' and the result. # #' @return A TADA data frame with six additional columns added for each pairing group specified #' in the pairing ref. diff --git a/tests/testthat/test-CriteriaComparison.R b/tests/testthat/test-CriteriaComparison.R new file mode 100644 index 00000000..5d1ff874 --- /dev/null +++ b/tests/testthat/test-CriteriaComparison.R @@ -0,0 +1,10 @@ +test_that("TADA_PairForCriteriaCalc function does not grow dataset", { + testdat1 <- TADA_RandomTestingData( + choose_random_state = FALSE, + number_of_days = 1, + autoclean = + ) + testdat2 <- TADA_PairForCriteriaCalc(testdat1) + expect_true(dim(testdat1)[1] == dim(testdat2)[1]) +}) +