Skip to contents

Evaluate an Expression with a Temporarily Seed

Usage

with_seed(expr, seed, ..., envir = parent.frame(), rounding = TRUE)

Arguments

expr

An expression to be evaluated.

seed

A single value to be passed to set.seed().

...

Further arguments to be passed to set.seed().

envir

The environment in which expr should be evaluated.

rounding

A logical scalar: should the default discrete uniform generation method in R versions prior to 3.6.0 be used? Usefull for unit testing.

Value

The results of expr evaluated.

See also