check_probability_range | R Documentation |
Check if a given numerical interval represents a probability range, that is a sub-interval of (0, 1) interval, that can optionally be closed at any side.
check_probability_range(x, bounds_closed = TRUE)
assert_probability_range(
x,
bounds_closed = TRUE,
.var.name = checkmate::vname(x),
add = NULL
)
test_probability_range(x, bounds_closed = TRUE)
expect_probability_range(
x,
bounds_closed = TRUE,
info = NULL,
label = vname(x)
)
x |
( |
bounds_closed |
( |
.var.name |
[ |
add |
[ |
info |
[ |
label |
[ |
TRUE
if successful, otherwise a string with the error message.
assertions
for more details.
x <- c(0, 0.2)
check_probability_range(x)
check_probability_range(rev(x))
check_probability_range(x, bounds_closed = FALSE)
check_probability_range(x, bounds_closed = c(FALSE, TRUE))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.