integer.rv {rv} | R Documentation |
Tests or coerces (numeric or logical-valued) random vector objects into integer-valued ones.
## S3 method for class 'rv': is.integer(x) ## S3 method for class 'rv': as.integer(x, ...)
x |
an rv object |
... |
other arguments |
is.integer(x)
returns TRUE
if and only if each component
of x
is integer-valued.
as.integer.rv
coerces an rv object into integer-valued one.
In effect, the function as.integer
is applied to all simulations.
Jouni Kerman kerman@stat.columbia.edu http://www.stat.columbia.edu/~kerman
Kerman, Jouni and Gelman, Andrew. Manipulating and Summarizing Posterior Simulations Using Random Variable Objects. Technical report, Columbia University, New York.
x <- rvpois(lambda=1) # some integer-valued random variable is.integer(x) # FALSE, because by default x is 'double'! x <- as.integer(x) # coerce to integer is.integer(x) # TRUE