Skip to content

Commit

Permalink
Fix for Issue #275
Browse files Browse the repository at this point in the history
test: move `set.seed()` to see if it resolves issue
  • Loading branch information
Max-Bladen committed Dec 6, 2022
1 parent 826a801 commit a5c0e9e
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions tests/testthat/test-tune.spca.R
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@

test_that("tune.spca works", {

set.seed(5212)

data(srbct)
X <- srbct$gene[1:20, 1:200]

grid.keepX <- seq(5, 35, 10)

set.seed(5212)
object <- tune.spca(X,ncomp = 2,
folds = 5,
test.keepX = grid.keepX, nrepeat = 3)
Expand All @@ -18,8 +18,6 @@ test_that("tune.spca works", {

test_that("tune.spca works with NA input", {

set.seed(5212)

data(srbct)
X <- srbct$gene[1:20, 1:200]

Expand All @@ -33,7 +31,8 @@ test_that("tune.spca works with NA input", {

grid.keepX <- seq(5, 35, 10)

expect_warning({object <- tune.spca(X,ncomp = 2,
expect_warning({set.seed(5212)
object <- tune.spca(X,ncomp = 2,
folds = 5,
test.keepX = grid.keepX, nrepeat = 3)},
"NAs present")
Expand Down

0 comments on commit a5c0e9e

Please sign in to comment.