rni | R Documentation |
Random number initialiser supporting spontaneous replication
rni(seed=0)
seed |
Integer, seed |
This is a convenience front end to set.seed
. A non-zero value of seed
is passed directly to set.seed
. Given a zero value (the default), the function calls Sys.time
to generate an unpredictable starting value – but the value ultimately passed to set.seed
is both output using cat
and returned invisibly, so can be used for unanticipated replica runs of a simulation.
Non-zero seed value that can be used to reproduce run subsequently
Peter Green (P.J.Green@bristol.ac.uk)
rni(0)
runif(6)
rni(0)
runif(6)
rni(3456)
runif(6)
rni(3456)
runif(6)
keep<-rni(0)
print(keep)
runif(6)
rni(keep)
runif(6)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.