Transpose a random array by permuting its dimensions and optionally resizing it.

# S3 method for rv
rep(x, times, ...)

Arguments

x

a random vector to be replicated

times

number of replications

...

further arguments passed to rep

Details

This is the rv-compatible version of the function rep.

Since rep is not a generic function, the whole name rep.rv must be specified when calling the function when x is an 'rv' object.

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

Author

Jouni Kerman jouni@kerman.com

Examples


  print(rep(rvnorm(1), times=4))
#>     mean sd   1% 2.5%   25%  50%  75% 97.5% 99% sims
#> [1]  0.1  1 -2.7   -2 -0.53 0.14 0.86     2 2.3  200
#> [2]  0.1  1 -2.7   -2 -0.53 0.14 0.86     2 2.3  200
#> [3]  0.1  1 -2.7   -2 -0.53 0.14 0.86     2 2.3  200
#> [4]  0.1  1 -2.7   -2 -0.53 0.14 0.86     2 2.3  200