# generate 1 seed (default)
genSeeds()
# generate 5 unique seeds
genSeeds(5)
# generate from nrow(design)
design <- createDesign(factorA=c(1,2,3),
factorB=letters[1:3])
seeds <- genSeeds(design)
seeds
# construct new seeds that are independent from original (use this sparingly)
newseeds <- genSeeds(design, old.seeds=seeds)
newseeds
# can be done in batches too
newseeds2 <- genSeeds(design, old.seeds=cbind(seeds, newseeds))
cbind(seeds, newseeds, newseeds2) # all unique
############
# generate seeds for runArraySimulation()
(iseed <- genSeeds()) # initial seed
seed_list <- genSeeds(design, iseed=iseed)
seed_list
# expand number of unique seeds given iseed (e.g., in case more replications
# are required at a later date)
seed_list_tmp <- genSeeds(nrow(design)*2, iseed=iseed)
str(seed_list_tmp) # first 9 seeds identical to seed_list
# more usefully for HPC, extract only the seed associated with an arrayID
arraySeed.15 <- genSeeds(nrow(design)*2, iseed=iseed, arrayID=15)
arraySeed.15
Run the code above in your browser using DataLab