rvifelse: Conditional Random Element Selection

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

View source: R/rvifelse.R

Description

rvifelse is the rv-compatible version of the function ifelse.

Usage

1
  rvifelse (test, yes, no)

Arguments

test

an object which can be coerced to logical mode.

yes

return values for true elements of test

no

return joint simulations and not simulations from each component separately

Details

rvifelse returns a random value with the same shape as test which is filled with random or constant elements selected from either yes or no, depending on whether the random draw in an element of test is TRUE or FALSE.

Value

A numeric array of dimensions size times length(x).

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

ifelse.


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

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