From 34459b766f98e0d0dbdd41da9d40c7adf3a72894 Mon Sep 17 00:00:00 2001 From: Laura A DeCicco Date: Thu, 1 Feb 2024 15:43:15 -0600 Subject: [PATCH 1/2] Clean up language a bit and add information on what's required --- vignettes/Join_closest.Rmd | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/vignettes/Join_closest.Rmd b/vignettes/Join_closest.Rmd index 23c9e60d..fbab8275 100644 --- a/vignettes/Join_closest.Rmd +++ b/vignettes/Join_closest.Rmd @@ -229,11 +229,27 @@ The inputs are: ```{r defFunc} -join_qw_uv <- function(qw_data, uv_flow_qw, - hour_threshold, - join_by_qw, join_by_uv, - qw_val_uv, qw_rmk_uv, - flow_val, flow_rmk){ +join_qw_uv <- function(qw_data, # data frame from readWQP + uv_flow_qw, # data frame from readNWISuv + hour_threshold, # hours threshold for joining + join_by_qw, # column to join by from qw_data + join_by_uv, # column to join by from uv_flow_qw + qw_val_uv, # value column name from uv_flow_qw for water quality parameter + qw_rmk_uv, # column name of remark column from uv_flow_qw + flow_val, # value column name from uv_flow_qw for flow parameter + flow_rmk, # column name of remark column from uv_flow_qw for flow parameter + ){ + + req_cols <- c("ResultDetectionConditionText", + "ResultMeasureValue", + "DetectionQuantitationLimitMeasure.MeasureValue") + + if(!all(req_cols %in% names(qw_data))){ + stop('qw_data requires columns: +"ResultDetectionConditionText", +"ResultMeasureValue", +"DetectionQuantitationLimitMeasure.MeasureValue"') + } qw_less <- qw_data |> filter(!is.na({{ join_by_qw }})) |> From 68cb0fd8fabe557504603ae5138d1d0d5a8b59cf Mon Sep 17 00:00:00 2001 From: Laura A DeCicco Date: Thu, 1 Feb 2024 16:39:56 -0600 Subject: [PATCH 2/2] wayward comma --- vignettes/Join_closest.Rmd | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/vignettes/Join_closest.Rmd b/vignettes/Join_closest.Rmd index fbab8275..85abe2c4 100644 --- a/vignettes/Join_closest.Rmd +++ b/vignettes/Join_closest.Rmd @@ -237,8 +237,7 @@ join_qw_uv <- function(qw_data, # data frame from readWQP qw_val_uv, # value column name from uv_flow_qw for water quality parameter qw_rmk_uv, # column name of remark column from uv_flow_qw flow_val, # value column name from uv_flow_qw for flow parameter - flow_rmk, # column name of remark column from uv_flow_qw for flow parameter - ){ + flow_rmk){ # column name of remark column from uv_flow_qw for flow parameter req_cols <- c("ResultDetectionConditionText", "ResultMeasureValue",