tests/testthat/test-independent-gridpts.R

test_that("compare gridpts results with gsDesign::normalGrid results", {
  x1 <- gsDesign2:::gridpts(r = 18, mu = 4, a = -Inf, b = Inf)
  x2 <- gsDesign::normalGrid(r = 18, bounds = c(-40, 40), mu = 4, sigma = 1)
  expect_equal(x1$w, x2$gridwgts)
  expect_equal(x1$z, x2$z)

  x1 <- gsDesign2:::gridpts(r = 18, mu = 2, a = -Inf, b = Inf)
  x2 <- gsDesign::normalGrid(r = 18, bounds = c(-40, 40), mu = 2, sigma = 1)
  expect_equal(x1$w, x2$gridwgts)
  expect_equal(x1$z, x2$z)
})

Try the gsDesign2 package in your browser

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

gsDesign2 documentation built on April 3, 2025, 9:39 p.m.