-
Notifications
You must be signed in to change notification settings - Fork 37
Open
Description
Coming back to commit aeea30e as an answer to issue #45 that added the following in GSEA_fgsea
function:
if (seed)
set.seed(.Random.seed)
I am not sure this is a good solution to set seed?
It seems that set.seed()
will use the first value its given, but the first value of .Random.seed doesn't change unless one changes the generator method (RNGkind): https://stackoverflow.com/questions/70585494/first-two-values-in-random-seed-are-always-the-same-with-different-set-seeds
I see two problems with this commit at the moment:
- using different seeds you'll always get the same results
- users cannot actually set their own seed
See below for the use of set.seed()
:
set.seed(1234, kind = "Mersenne-Twister")
.Random.seed[1]
#[1] 10403
set.seed(.Random.seed, kind = "Mersenne-Twister")
y <- .Random.seed
set.seed(10403, kind = "Mersenne-Twister")
z <- .Random.seed
all(y == z)
#[1] TRUE
Metadata
Metadata
Assignees
Labels
No labels