R Under development (unstable) (2024-02-14 r85901 ucrt) -- "Unsuffered Consequences" Copyright (C) 2024 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > library(cpr) > > # testing of the newknots method > > ################################################################################ > # check that the method is not exported > stopifnot(!grepl("newknots", ls("package:cpr"))) > cpr_namespace <- ls( getNamespace("cpr"), all.names = TRUE) > stopifnot(sum(cpr_namespace == "newknots") == 1L) > stopifnot(sum(grepl("^newknots$", cpr_namespace)) == 1L) > > ################################################################################ > > cp0 <- cp(log(pdg) ~ bsplines(day, iknots = c(-.25, 0, 0.25), bknots = c(-1, 1)), data = spdg) > > expected <- log(pdg) ~ bsplines(day, iknots = c(-0.85, 0, 0.25, 0.3), bknots = c(-1, 1)) > > test <- cpr:::newknots(cp0$call$formula, c(-0.85, 0, 0.25, 0.3)) > > stopifnot(isTRUE( all.equal(expected, test))) > > ################################################################################ > # End of File # > ################################################################################ > > proc.time() user system elapsed 1.67 0.25 1.90