as.vector.rv: Coerce an rv object

Description Usage Arguments Details Author(s) References Examples

View source: R/as_vector_rv.R

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

1
2
  ## S3 method for class '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.

Author(s)

Jouni Kerman jouni@kerman.com

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

1
2
  x <- rvmatrix(rvnorm(10), 2, 5)
  as.vector(x)


rv documentation built on May 19, 2017, 7:09 p.m.
Search within the rv package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs in the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.