0

How can I get the current seed from the current RNG state in R? For instance,

a <- 1987
set.seed(a) 
b <- .Random.seed 

How can I retrieve a (i.e., 1987) from b? Thank you.

2
  • I don't think you can. Strongly related: stackoverflow.com/q/65881975/3358272. Why are you trying to retrieve the integer seed from the current state of the RNG? Commented Mar 23, 2022 at 23:03
  • 2
    not sure the point or if it is possible, but you can brute force it s <- lapply(1:10000, function(x) {set.seed(x); .Random.seed}); which(sapply(s, identical, b)) or you could write a while loop to run longer Commented Mar 24, 2022 at 0:26

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.