Learn R Programming

rv (version 0.949)

as.double.rv: Coercing Random Vectors to Real-valued

Description

Coerces random vector objects into double-valued ones.

Usage

## S3 method for class 'rv':
as.double(x, \dots)
  ## S3 method for class 'rv':
as.real(x, \dots)

Arguments

x
an rv object
...
other arguments

Details

as.double coerces an rv object into double-valued one. In effect, the function as.double is applied to all simulations.

as.real is a synonym.

References

Kerman, Jouni and Gelman, Andrew. Manipulating and Summarizing Posterior Simulations Using Random Variable Objects. Technical report, Columbia University, New York.

See Also

integer.rv

Examples

Run this code
x <- as.logical(rvbern(prob=0.5)) 
  print(x)
  print(as.double(x))

Run the code above in your browser using DataLab