From 3875d4e56b8446d4513375a9a8fa5475dcff2fc3 Mon Sep 17 00:00:00 2001 From: Jason Brown Date: Tue, 12 Dec 2023 13:50:29 -0500 Subject: [PATCH] set all b and n wells to 0 conc and after check for any remaining nulls and throw error --- R/tcplWriteLvl0.R | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/R/tcplWriteLvl0.R b/R/tcplWriteLvl0.R index b02c7864..a04f66af 100644 --- a/R/tcplWriteLvl0.R +++ b/R/tcplWriteLvl0.R @@ -104,10 +104,13 @@ tcplWriteLvl0 <- function(dat, type) { if (dat[, any(is.na(acid))]) { stop("No ACID supplied for some samples. Ensure all samples have an ACID then rerun.") } + + #set all na b or n wells to conc = 0 + dat[is.na(conc) & (wllt %in% c('b', 'n')), conc:=0] - ## Check for 0 concentration values - if (dat[,any(conc == 0)]) { - stop("Cannot process a concentration value of 0. Confirm source document lists 0 as concentration value and rerun with dummy value of .01") + ## Check for null concentration values + if (dat[,any(is.na(conc))]) { + stop("Cannot process a NULL concentration value. Update missing concentration value then rerun.") } ## Check wllt has been set for all samples