inst/tests/test-spline.r

#' @name test_spline
#' @title Test spline function

test_that("Spline Correct", {
    
    # test scripts do not seem to recognize loaded libraries:
#     library(car)
#     library(clinfun)
#     library(multcomp)
#     library(pgirmess)
#     library(DTK)
#     library(mgcv)
#     library(segmented)

    dose <- DRdata[,"dose"]
    targetvariable <- DRdata[,"MF_Log"]
    spline <- mgcv::gam(targetvariable~s(dose, k=4), data=DRdata)
    
    expect_that (round(spline$coefficients[1], digits = 6), is_equivalent_to(2.142013))
    
    }
)

Try the drsmooth package in your browser

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

drsmooth documentation built on May 1, 2019, 10:28 p.m.