rv (version 2.3.4)

as.vector.rv: Coerce an rv object

Description

as.vector.rv coerces a given rv object into a vector; matrices lose their dimension attributes, but rv objects stay as rv objects (since they are considered to be "vectors").

Usage

# S3 method for rv
as.vector(x, mode = "any")

Arguments

x

an object

mode

(currently not used)

Details

as.vector.rv removes the dimension attribute and returns the rv object. Needed for compatibility with code that uses as.vector.

References

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").

Examples

Run this code
# NOT RUN {
  x <- rvmatrix(rvnorm(10), 2, 5)
  as.vector(x)

# }

Run the code above in your browser using DataLab