Skip to content

Commit

Permalink
change error message for available QC data checks in tabMWRacc #61
Browse files Browse the repository at this point in the history
  • Loading branch information
fawda123 committed Oct 4, 2023
1 parent b94c95a commit f0c02f2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions R/tabMWRacc.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-tabMWRacc.R
Original file line number Diff line number Diff line change
Expand Up @@ -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'
)
)
})
Expand Down

0 comments on commit f0c02f2

Please sign in to comment.