is_discrete {distributions3} | R Documentation |
Generic functions for determining whether a certain probability distribution is discrete or continuous, respectively.
is_discrete(d, ...)
is_continuous(d, ...)
d |
An object. The package provides methods for distribution
objects such as those from |
... |
Arguments passed to methods. Unevaluated arguments will generate a warning to catch mispellings or other possible errors. |
The generic function is_discrete
is intended to return TRUE
for every distribution whose entire support is discrete and FALSE
otherwise. Analogously, is_continuous
is intended to return TRUE
for every distribution whose entire support is continuous and FALSE
otherwise. For mixed discrete-continuous distributions both methods should
return FALSE
.
Methods for both generics are provided for all distribution
classes
set up in this package.
A logical vector indicating whether the distribution(s) in d
is/are discrete or continuous, respectively.
X <- Normal()
is_discrete(X)
is_continuous(X)
Y <- Binomial(size = 10, p = c(0.2, 0.5, 0.8))
is_discrete(Y)
is_continuous(Y)