Skip to content

Commit

Permalink
removed is.probability funtion and replaced use in other calls by tes…
Browse files Browse the repository at this point in the history
…t_probability from additional checkmate assertions
  • Loading branch information
dimitriskontosBAY committed Oct 3, 2023
1 parent d0bc446 commit 065d9bb
Showing 1 changed file with 1 addition and 18 deletions.
19 changes: 1 addition & 18 deletions R/helpers.R
Original file line number Diff line number Diff line change
Expand Up @@ -173,23 +173,6 @@ safeInteger <- function(x) {
as.integer(x)
}

##' Predicate checking for a probability
##'
##' @param x the object being checked
##' @param bounds whether to include the bounds 0 and 1 (default)
##' @return Returns \code{TRUE} if \code{x} is a probability
##'
##' @keywords internal
is.probability <- function(x,
bounds = TRUE) {
return(is.scalar(x) &&
if (bounds) {
0 <= x && 1 >= x
} else {
0 < x && 1 > x
})
}

##' Predicate checking for a numeric range
##'
##' @param x the object being checked
Expand All @@ -211,7 +194,7 @@ is.range <- function(x) {
is.probRange <- function(x,
bounds = TRUE) {
return(is.range(x) &&
all(sapply(x, is.probability, bounds = bounds)))
all(sapply(x, test_probability, bounds = bounds)))
}


Expand Down

0 comments on commit 065d9bb

Please sign in to comment.