Learn R Programming

rv (version 0.949)

setnsims: Set or Get the Default Number of Simulations to Generate for rv Objects

Description

Sets or retrieves the default number of simulations.

Usage

setnsims(nsims)
  getnsims()

Arguments

nsims
Number of simulations.

Value

  • If nsims is specified, returns the old value, else returns the current value.

Details

getnsims() is an alias for the function call setnsims().

References

Kerman, Jouni and Gelman, Andrew. Manipulating and Summarizing Posterior Simulations Using Random Variable Objects. Technical report, Columbia University, New York.

Examples

Run this code
setnsims(1000) # set n.sims to 1000
  s <- setnsims(10000) # s is now 1000
  print(getnsims()) # prints 10000
  setnsims(s) # restore the number of simulations back to 1000

Run the code above in your browser using DataLab