Skip to content

Commit

Permalink
[dims] simplify check
Browse files Browse the repository at this point in the history
  • Loading branch information
JanMarvin committed Sep 12, 2024
1 parent 5777f4b commit 85ed2d5
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -716,14 +716,10 @@ wb_dims <- function(..., select = NULL) {
}

if (!is.null(cols_arg)) {
# cols_arg could be name(s) in x or must indicate a positive integer
is_lwr_one <- FALSE
if (!is.null(args$x)) {
if (!all(cols_arg %in% names(args$x)))
is_lwr_one <- min(col2int(cols_arg)) < 1L
} else {
# cols_arg could be name(s) in x or must indicate a positive integer
if (is.null(args$x) || (!is.null(args$x) && !all(cols_arg %in% names(args$x))))
is_lwr_one <- min(col2int(cols_arg)) < 1L
}

if (is_lwr_one)
stop("You must supply positive values to `cols`")
Expand Down

0 comments on commit 85ed2d5

Please sign in to comment.