Asserts that x
is either a count or positive infinity (Inf
).
Arguments
- x
Object to check.
- ...
Further arguments passed on to
checkmate::assert_count()
.
See also
Other functions extending the checkmate package:
assert_class_any()
,
assert_cli()
,
assert_df_or_tibble()
,
assert_mime_type()
,
assert_pkg()
Examples
pal::assert_inf_count(1001L)
pal::assert_inf_count(1)
pal::assert_inf_count(0.0)
pal::assert_inf_count(Inf)
try(
pal::assert_inf_count(-1)
)
#> Error in pal::assert_inf_count(-1) :
#> Assertion on 'x' failed: Must be >= 0.
try(
pal::assert_inf_count(1.5)
)
#> Error in pal::assert_inf_count(1.5) :
#> Assertion on 'x' failed: Must be of type 'count', not 'double'.
try(
pal::assert_inf_count(-Inf)
)
#> Error in pal::assert_inf_count(-Inf) :
#> `x` must either be a single integerish value or positive infinity (`Inf`).