Skip to content

Commit

Permalink
shouldn't delete seed each time actually
Browse files Browse the repository at this point in the history
  • Loading branch information
emitanaka committed Oct 15, 2023
1 parent 6b02829 commit 102ba06
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions R/provenance.R
Original file line number Diff line number Diff line change
Expand Up @@ -697,9 +697,8 @@ Provenance <- R6::R6Class("Provenance",
save_seed = function(seed, type) {
private$record_track_internal()
ranexists <- exists(".Random.seed", envir = .GlobalEnv, inherits = FALSE)
if (ranexists) rm(.Random.seed, envir = .GlobalEnv)
stats::runif(1)
if (is.null(seed)) {
if(!ranexists) stats::runif(1)
if(is.null(seed)) {
RNGstate <- get(".Random.seed", envir = .GlobalEnv)
} else {
set.seed(seed)
Expand Down

0 comments on commit 102ba06

Please sign in to comment.