logical.rv {rv} | R Documentation |
is.logical(x)
returns TRUE
for each component that
contains an logical-valued vector, otherwise FALSE
is given.
## S3 method for class 'rv': is.logical(x) ## S3 method for class 'rv': as.logical(x, ...)
x |
an rv object |
... |
Further arguments passed on |
is.logical(x)
returns TRUE
if and only if each component
of x
is logical-valued (i.e. TRUE
/FALSE
).
as.logical.rv
coerces an rv object into logical-valued one.
In effect, the function as.logical
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 <- rvbern(prob=0.5) # some 0/1 valued random variable is.logical(x) # FALSE, because by default x is 'double' x <- as.logical(x) # coerce to logical; all zeros become FALSE, ones become TRUE is.logical(x) # TRUE