Skip to content

Commit

Permalink
Merge pull request #73 from inbo/fix_nesting
Browse files Browse the repository at this point in the history
Fix #72
  • Loading branch information
florisvdh authored Jan 11, 2021
2 parents 8b5196d + 19e0b2b commit 15c3e09
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions R/selectlocs.R
Original file line number Diff line number Diff line change
Expand Up @@ -553,10 +553,11 @@ selectlocs_xg3 <- function(data,
filter(str_detect(.data$statistic, "ser_")),
by = c("xg3_variable",
"statistic")) %>%
complete(.data$loc_code, nesting(.data$xg3_variable,
.data$statistic,
.data$criterion,
.data$direction)) %>%
complete(.data$loc_code, with(.data,
nesting(xg3_variable,
statistic,
criterion,
direction))) %>%
mutate(cond_met =
ifelse(.data$direction == "min", .data$value >= .data$criterion,
ifelse(.data$direction == "max", .data$value <= .data$criterion,
Expand Down Expand Up @@ -1225,10 +1226,11 @@ selectlocs <- function(data,
right_join(conditions,
by = c("variable",
"statistic")) %>%
complete(.data$loc_code, nesting(.data$variable,
.data$statistic,
.data$criterion,
.data$direction)) %>%
complete(.data$loc_code, with(.data,
nesting(variable,
statistic,
criterion,
direction))) %>%
mutate(cond_met =
ifelse(.data$direction == "min", .data$value >= .data$criterion,
ifelse(.data$direction == "max", .data$value <= .data$criterion,
Expand Down

0 comments on commit 15c3e09

Please sign in to comment.