as.integer.rv | R Documentation |
Coerces a random variable to an integer-valued (discrete) one
## S3 method for class 'rv' as.integer(x, ...)
x |
an rv object |
... |
Further arguments passed on |
In effect, the function as.integer
is applied to all simulations.
is.integer(x)
returns TRUE
if and only if each
component of x
is integer-valued (each simulation vector is of type
'integer').
Jouni Kerman jouni@kerman.com
Kerman, J. and Gelman, A. (2007). Manipulating and Summarizing Posterior Simulations Using Random Variable Objects. Statistics and Computing 17:3, 235-244.
See also vignette("rv")
.
as.logical.rv
.
x <- rvpois(lambda=3) # some integer-valued random variable print(x) is.integer(x) # FALSE, because by default x is 'double'! x <- as.integer(x) # coerce to integer is.integer(x) # TRUE print(x) # Shows also the 'min' and 'max' columns
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.