tests/testthat/test-splineDesigncpp.R

library(splines)

testthat::test_that("splineDesigncpp: default values", {
  testthat::expect_equal(splineDesigncpp(knots = 1:10, x = 4:7),
                         splineDesign(knots = 1:10, x = 4:7))
})

testthat::test_that("splineDesigncpp: derivatives", {
  testthat::expect_equal(splineDesigncpp(knots = 1:10, x = 4:7, 
                                         derivs = 0:2),
                         splineDesign(knots = 1:10, x = 4:7, 
                                      derivs = 0:2))
})

Try the trtswitch package in your browser

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

trtswitch documentation built on Nov. 2, 2024, 1:07 a.m.