From f0c02f2d74f68e1eb10f86ea3c72e8fb9c69fa1c Mon Sep 17 00:00:00 2001 From: fawda123 Date: Wed, 4 Oct 2023 07:49:20 -0400 Subject: [PATCH] change error message for available QC data checks in tabMWRacc #61 --- R/tabMWRacc.R | 6 +++--- tests/testthat/test-tabMWRacc.R | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/R/tabMWRacc.R b/R/tabMWRacc.R index f427b55c..b24277eb 100644 --- a/R/tabMWRacc.R +++ b/R/tabMWRacc.R @@ -88,10 +88,10 @@ tabMWRacc <- function(res = NULL, acc = NULL, frecom = NULL, fset = NULL, runchk if(all(chk)) stop('No QC records or reference values for parameters with defined DQOs. Cannot create QC tables.', call. = FALSE) - # warning for invalid accchk entry, indication of valid acchk entries + # warning for accchk entry with no data, indication of acchk entries with data if(warn){ - valent <- paste(names(chk)[!chk], collapse = ', ') - msg <- paste0('No data to check for ', accchk, ', valid accchk entries include ', valent) + datent <- paste(names(chk)[!chk], collapse = ', ') + msg <- paste0('No data to check for ', accchk, ', data available for ', datent) warning(msg, call. = FALSE) } diff --git a/tests/testthat/test-tabMWRacc.R b/tests/testthat/test-tabMWRacc.R index b87d0860..c3211e3b 100644 --- a/tests/testthat/test-tabMWRacc.R +++ b/tests/testthat/test-tabMWRacc.R @@ -14,7 +14,7 @@ test_that("Checking output format type warning if individual and no table", { expect_warning( expect_null( tabMWRacc(chk, accdat, frecomdat, runchk = F, warn = T, type = 'individual', accchk = 'Field Blanks'), - 'No data to check for Field Blanks, valid accchk entries include Lab Blanks, Field Duplicates, Lab Duplicates, Lab Spikes / Instrument Checks' + 'No data to check for Field Blanks, data available for Lab Blanks, Field Duplicates, Lab Duplicates, Lab Spikes / Instrument Checks' ) ) })