Skip to content

Commit 7c1cba5

Browse files
committed
Improve range_validate()
1 parent 382bc23 commit 7c1cba5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

R/aaa_ranges.R

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,12 @@ range_validate <- function(
8181
if (!any(is_num)) {
8282
cli::cli_abort("{.arg range} should be numeric.", call = call)
8383
}
84+
if (range[[1]] > range[[2]]) {
85+
cli::cli_abort(
86+
"The {.arg range} lower bound ({range[[1]]}) must not exceed upper bound ({range[[2]]}).",
87+
call = call
88+
)
89+
}
8490

8591
# TODO check with transform
8692
} else {

0 commit comments

Comments
 (0)