powered by
Return the number of discrete values in x that lie between from and to, or test whether the number of discrete values is infinite.
x
from
to
num_discretes( x, from = -Inf, to = Inf, ..., include_from = TRUE, include_to = TRUE, tol = sqrt(.Machine$double.eps) )
For num_discretes(), a single non-negative integer, or possibly Inf for infinitely many discrete values.
num_discretes()
Inf
Numeric series (numeric vector or object of class "discretes").
numeric
"discretes"
Reference values, possibly infinite. from must be less than or equal to to; both must be length-1 numeric vectors.
Reserved for future extensions; must be empty.
Should the from value be included in the query? Should the to value? Both must be length-1 logical vectors.
Numerical tolerance when checking if a value is in the series. Single non-negative numeric. See next_discrete() for details.
next_discrete()
num_discretes(-3:3) num_discretes(c(0.4, 0.4, 0.4, 0)) x <- arithmetic(-3.2, spacing = 0.5) num_discretes(x) num_discretes(x, from = -2, to = 2) num_discretes(1 / x, from = -2, to = 2)
Run the code above in your browser using DataLab