check_proportion(x, null.ok = FALSE)
assert_proportion(
x,
null.ok = FALSE,
.var.name = checkmate::vname(x),
add = NULL
)
test_proportion(x, null.ok = FALSE)
expect_proportion(x, null.ok = FALSE, info = NULL, label = vname(x))
an object to check.
(flag
)
whether x
may also be NULL
.
(string
)
name of the checked object to print in
assertions; defaults to the heuristic implemented in checkmate::vname()
.
(AssertCollection
or NULL
)
collection to store
assertion messages, see checkmate::AssertCollection
.
(string
)
extra information to be included in the
message for the testthat reporter, see testthat::expect_that()
.
(string
)
name of the checked object to print in
messages. Defaults to the heuristic implemented in checkmate::vname()
.
TRUE
if successful, otherwise a string with the error message.
assertions
for more details.
check_proportion(0.25)
#> [1] TRUE