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 June 8, 2025, 1:45 p.m.