Skip to content

Commit

Permalink
Merge pull request #379 from ldecicco-USGS/main
Browse files Browse the repository at this point in the history
Clean up language a bit and add information on what's required
  • Loading branch information
ldecicco-USGS authored Feb 1, 2024
2 parents 9f4f084 + 68cb0fd commit 9cc2d17
Showing 1 changed file with 20 additions and 5 deletions.
25 changes: 20 additions & 5 deletions vignettes/Join_closest.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -229,11 +229,26 @@ 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 }})) |>
Expand Down

0 comments on commit 9cc2d17

Please sign in to comment.