Probing discrete values in a distribution
discretes.Rd
next_discrete()
and prev_discrete()
find the n
discrete values
in a distribution next to a reference point. num_discretes()
finds
the number of discrete values within a range. has_infinite_discretes()
checks whether there are an infinite amount of discrete values between
a range of values.
Usage
next_discrete(distribution, from, n = 1L, include_from = FALSE)
prev_discrete(distribution, from, n = 1L, include_from = FALSE)
num_discretes(distribution, from, to, include_from, include_to)
has_infinite_discretes(distribution, from = -Inf, to = Inf)
Value
For next_discrete()
and prev_discrete()
, a vector of
all available discrete points satisfying the query.
If less values are available than asked
via n
, only those values are returned.
If infinite values satisfy the query, an error is thrown;
NaN
occurs when no one particular discrete value follows, such as
when asking for the integer that comes before infinity.
For num_discretes()
, a single non-negative integer, possibly infinite.
Possibly also NA_integer_
if there's not enough information to
determine this.
For has_infinite_discretes()
, a single logical, possibly NA
if
there's not enough information to determine this.