tests/testthat/test_util.R

test_that('restoring the random seed works', {
  if (!exists('.Random.seed')) RNGkind()
  seed <- .Random.seed
  first <- with_seed(0, rnorm(10))
  second <- with_seed(0, rnorm(10))
  expect_equal(.Random.seed, seed)
  expect_equal(first, second)
})

Try the MFKnockoffs package in your browser

Any scripts or data that you put into this service are public.

MFKnockoffs documentation built on May 2, 2019, 6:33 a.m.