Description Usage Arguments Details Value Functions Examples
Functions related to generating random seeds and utilising them for reproducibility.
1 2 3 4 5 6 7 8 9 |
seed |
The random seed to be used |
reset |
Should the fixed seed be forced to reset |
expression |
expression to be evaluated |
x |
object to extract the |
Random values are generated based on the current seed used by the R system. This means by deliberately setting a seed in R, we can make work reproducible.
gen_seed()
returns a single numeric value
with_seed()
returns the value of the evaluated expression after
with the relevant seed as an attribute (if required)
pull_seed()
returns a single numeric value
fix_seed()
and set_seed()
do not return anything
gen_seed
: Generates a random seed, which can be used in set_seed()
set_seed
: Sets the current seed
fix_seed
: Resets the seed to re-run code
with_seed
: Evaluates the expression after setting the seed.
If seed
is TRUE
, then it first generates a seed using
gen_seed()
. Results are output with the seed
attached (if set).#'
pull_seed
: Extracts the seed used to generate the results of
with_seed()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.