R Under development (unstable) (2023-11-28 r85645 ucrt) -- "Unsuffered Consequences" Copyright (C) 2023 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) > > ################################################################################ > # test that matrix rank is as expected > set.seed(42) > mat <- matrix(rnorm(25000 * 120), nrow = 25000) > stopifnot(identical(matrix_rank(mat), 120)) > > ################################################################################ > # test that matrix rank of a full rank bspline basis is as expected > bmat <- bsplines(seq(0, 1, length = 100), df = 15) > stopifnot(identical(matrix_rank(bmat), 15)) > > ################################################################################ > # test that matrix rank of a rank-deficient bspline basis > bmat <- bsplines(seq(0, 1, length = 100), iknots = c(0.001, 0.002)) > stopifnot(identical(ncol(bmat), 6L)) > stopifnot(identical(matrix_rank(bmat), 5)) > > ################################################################################ > ## End of File ## > ################################################################################ > > proc.time() user system elapsed 0.85 0.09 0.93