Skip to content

Commit af1a529

Browse files
committed
Fix to ! conditions
1 parent abf45e4 commit af1a529

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

R/classify_nuts.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ classify_nuts <-
8282
rename(from_code = !!sym(nuts_code))
8383

8484
# Simple NUTS code check
85-
if (!(any(str_detect(data$from_code, "^[A-Za-z]{2}[A-Za-z0-9]{1,3}$"))))
85+
if (any(!(str_detect(data$from_code, "^[A-Za-z]{2}[A-Za-z0-9]{1,3}$"))))
8686
cli_abort(
8787
c(
8888
"Variable {.var {nuts_code}} contains invalid NUTS codes.",
@@ -93,7 +93,7 @@ classify_nuts <-
9393

9494
# Grouping vars, country identified by default
9595
if (!is.null(group_vars)) {
96-
if (!(any(group_vars %in% colnames(data)))) {
96+
if (any(!(group_vars %in% colnames(data)))) {
9797
cli_abort("Input {.arg group_vars} not found in the provided data frame.")
9898
}
9999
group_vars <- c("country", group_vars)

R/convert_nuts_level.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ convert_nuts_level <-
6262
if (is.null(variables))
6363
cli_abort("Input {.arg variables} cannot be NULL.")
6464

65-
if (!(any(names(variables) %in% colnames(data[["data"]]))))
65+
if (any(!(names(variables) %in% colnames(data[["data"]]))))
6666
cli_abort("Input {.arg variables} not found in the provided data frame.")
6767

6868
if (any(!(unlist(variables) %in% c("absolute", "relative"))))

R/convert_nuts_version.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ convert_nuts_version <-
7777
if (is.null(variables))
7878
cli_abort("Input {.arg variables} cannot be NULL.")
7979

80-
if (!(any(names(variables) %in% colnames(data[["data"]]))))
80+
if (any(!(names(variables) %in% colnames(data[["data"]]))))
8181
cli_abort("Input {.arg variables} not found in the provided data frame.")
8282

8383
if (any(!(unlist(variables) %in% c("absolute", "relative"))))

0 commit comments

Comments
 (0)