Skip to contents

`seed = NULL` runs `code` against the ambient RNG stream unchanged, so a caller can still get reproducibility with a plain `set.seed()` before the call. Any other value makes the call self-contained and repeatable without perturbing the caller's stream.

Usage

with_local_seed(seed, code)

Arguments

seed

integer seed, or NULL to use the ambient RNG stream

code

expression to evaluate

Value

the value of `code`