rvcut: Convert Numeric to Random Factor

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/rvcut.R

Description

Convert implements the ‘cut’ function using random variables.

Usage

1
2
3
  rvcut(x, ...)
  ## S3 method for class 'rv'
rvcut(x, ...)

Arguments

x

a plain or a random vector which is to be converted to a factor by cutting.

...

arguments passed to the function cut.

Value

A random factor.

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

See Also

rvfactor, cut.

Examples

1
  rvcut(rvnorm(1), breaks=c(-Inf,-2,-1,0,1,2,Inf))

rv documentation built on May 29, 2017, 8:53 p.m.

Search within the rv package
Search all R packages, documentation and source code