check_probability | R Documentation |
Check if a given value represents a probability, that is a number within (0, 1) interval, that can optionally be closed at any side.
check_probability(x, bounds_closed = TRUE)
assert_probability(
x,
bounds_closed = TRUE,
.var.name = checkmate::vname(x),
add = NULL
)
test_probability(x, bounds_closed = TRUE)
expect_probability(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.
check_probability(0.5)
check_probability(0, bounds_closed = FALSE)
check_probability(0, bounds_closed = c(FALSE, TRUE))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.