diff --git a/R/processQWData.r b/R/processQWData.r index 9e5866f2c955ba477de97562945b1e743ddafa6c..6de7ddc527c721f35bcb067152df529a8d5403a9 100644 --- a/R/processQWData.r +++ b/R/processQWData.r @@ -15,19 +15,24 @@ #' rawSampleSelect <- processQWData(rawSample) processQWData <- function(data){ - qualifier <- ifelse( - ( - ( - data$ResultDetectionConditionText == "Not Detected" - & length(grep("Lower", data$DetectionQuantitationLimitTypeName)) > 0 - ) - | - ( - data$ResultMeasureValue < data$DetectionQuantitationLimitMeasure.MeasureValue - & data$ResultValueTypeName == "Actual" - ) - ),"<","" - ) + qualifier <- ifelse((rawData$ResultDetectionConditionText == "Not Detected" | + rawData$ResultDetectionConditionText == "Detected Not Quantified" | + data$ResultMeasureValue < data$DetectionQuantitationLimitMeasure.MeasureValue),"<","") + + +# qualifier <- ifelse( +# ( +# ( +# data$ResultDetectionConditionText == "Not Detected" +# & length(grep("Lower", data$DetectionQuantitationLimitTypeName)) > 0 +# ) +# | +# ( +# data$ResultMeasureValue < data$DetectionQuantitationLimitMeasure.MeasureValue +# & data$ResultValueTypeName == "Actual" +# ) +# ),"<","" +# ) correctedData<-ifelse((nchar(qualifier)==0),data$ResultMeasureValue,data$DetectionQuantitationLimitMeasure.MeasureValue) test <- data.frame(data$USGSPCode)