Skip to content

Commit d5bd1a8

Browse files
committed
use seeds for generating data for tests
1 parent 319b0b2 commit d5bd1a8

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

tests/testthat/data-for-mcmc-tests.R

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
# Prepare input objects
1+
set.seed(8420)
22

3+
# Prepare input objects
34
arr <- array(rnorm(4000), dim = c(100, 4, 10))
45
arr1chain <- arr[, 1, , drop = FALSE]
56
mat <- matrix(rnorm(1000), nrow = 100, ncol = 10)
@@ -24,6 +25,8 @@ chainlist1 <- list(chainlist[[1]][, 1, drop=FALSE],
2425
dframe_multiple_chains <- dframe
2526
dframe_multiple_chains$chain <- rep(1:4, 25)
2627

28+
29+
# for vdiffr visual tests
2730
set.seed(11172017)
2831
vdiff_dframe <- as.data.frame(matrix(rnorm(1000), nrow = 100, ncol = 5))
2932
vdiff_dframe_chains <- as.data.frame(

tests/testthat/data-for-ppc-tests.R

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
set.seed(8420)
12
y <- rnorm(100)
23
yrep <- matrix(rnorm(2500), ncol = 100)
34
group <- gl(4, 25, labels = LETTERS[1:4])
@@ -6,6 +7,8 @@ y2 <- rpois(30, 1)
67
yrep2 <- matrix(rpois(30, 1), ncol = 30)
78
group2 <- rep(1, 30)
89

10+
11+
# for vdiffr visual tests
912
set.seed(11172017)
1013
vdiff_y <- rnorm(100)
1114
vdiff_yrep <- matrix(rnorm(2500), ncol = 100)

0 commit comments

Comments
 (0)