Running ‘testthat.R’ [122s/176s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(dimRed)
  Loading required package: DRR
  Loading required package: kernlab
  Loading required package: CVST
  Loading required package: Matrix
  
  Attaching package: 'dimRed'
  
  The following object is masked from 'package:stats':
  
      embed
  
  The following object is masked from 'package:base':
  
      as.data.frame
  
  > 
  > test_check("dimRed")
  predictors:  PC1 PC2 dependent:  PC3 
  sigma=0.001 kernel=rbfdot lambda=0 nblocks=4 ( 3489.446 )
  sigma=0.01 kernel=rbfdot lambda=0 nblocks=4 ( 3560.406 )
  sigma=0.1 kernel=rbfdot lambda=0 nblocks=4 ( 125765.4 )
  sigma=1 kernel=rbfdot lambda=0 nblocks=4 ( 254697.5 )
  sigma=10 kernel=rbfdot lambda=0 nblocks=4 ( 6.796259 )
  sigma=100 kernel=rbfdot lambda=0 nblocks=4 ( 0.3183248 )
  sigma=1000 kernel=rbfdot lambda=0 nblocks=4 ( 0.4596887 )
  sigma=10000 kernel=rbfdot lambda=0 nblocks=4 ( 0.4913171 )
  sigma=0.001 kernel=rbfdot lambda=0.001 nblocks=4 ( 0.4997224 )
  sigma=0.01 kernel=rbfdot lambda=0.001 nblocks=4 ( 0.4998376 )
  sigma=0.1 kernel=rbfdot lambda=0.001 nblocks=4 ( 0.527291 )
  sigma=1 kernel=rbfdot lambda=0.001 nblocks=4 ( 0.1912578 )
  sigma=10 kernel=rbfdot lambda=0.001 nblocks=4 ( 0.1136177 )
  sigma=100 kernel=rbfdot lambda=0.001 nblocks=4 ( 0.3039094 )
  sigma=1000 kernel=rbfdot lambda=0.001 nblocks=4 ( 0.4604236 )
  sigma=10000 kernel=rbfdot lambda=0.001 nblocks=4 ( 0.4913211 )
  sigma=0.001 kernel=rbfdot lambda=0.01 nblocks=4 ( 0.4995983 )
  sigma=0.01 kernel=rbfdot lambda=0.01 nblocks=4 ( 0.5013133 )
  sigma=0.1 kernel=rbfdot lambda=0.01 nblocks=4 ( 0.508778 )
  sigma=1 kernel=rbfdot lambda=0.01 nblocks=4 ( 0.1959162 )
  sigma=10 kernel=rbfdot lambda=0.01 nblocks=4 ( 0.102913 )
  sigma=100 kernel=rbfdot lambda=0.01 nblocks=4 ( 0.3097342 )
  sigma=1000 kernel=rbfdot lambda=0.01 nblocks=4 ( 0.4607473 )
  sigma=10000 kernel=rbfdot lambda=0.01 nblocks=4 ( 0.4913236 )
  sigma=0.001 kernel=rbfdot lambda=0.1 nblocks=4 ( 0.4981 )
  sigma=0.01 kernel=rbfdot lambda=0.1 nblocks=4 ( 0.5011221 )
  sigma=0.1 kernel=rbfdot lambda=0.1 nblocks=4 ( 0.5035565 )
  sigma=1 kernel=rbfdot lambda=0.1 nblocks=4 ( 0.2353258 )
  sigma=10 kernel=rbfdot lambda=0.1 nblocks=4 ( 0.1223436 )
  sigma=100 kernel=rbfdot lambda=0.1 nblocks=4 ( 0.3159164 )
  sigma=1000 kernel=rbfdot lambda=0.1 nblocks=4 ( 0.4626848 )
  sigma=10000 kernel=rbfdot lambda=0.1 nblocks=4 ( 0.4914667 )
  sigma=0.001 kernel=rbfdot lambda=1 nblocks=4 ( 0.4958111 )
  sigma=0.01 kernel=rbfdot lambda=1 nblocks=4 ( 0.4982627 )
  sigma=0.1 kernel=rbfdot lambda=1 nblocks=4 ( 0.501947 )
  sigma=1 kernel=rbfdot lambda=1 nblocks=4 ( 0.3865362 )
  sigma=10 kernel=rbfdot lambda=1 nblocks=4 ( 0.2298566 )
  sigma=100 kernel=rbfdot lambda=1 nblocks=4 ( 0.3822837 )
  sigma=1000 kernel=rbfdot lambda=1 nblocks=4 ( 0.4754043 )
  sigma=10000 kernel=rbfdot lambda=1 nblocks=4 ( 0.4921208 )
  sigma=0.001 kernel=rbfdot lambda=10 nblocks=4 ( 0.4945264 )
  sigma=0.01 kernel=rbfdot lambda=10 nblocks=4 ( 0.4954349 )
  sigma=0.1 kernel=rbfdot lambda=10 nblocks=4 ( 0.4973018 )
  sigma=1 kernel=rbfdot lambda=10 nblocks=4 ( 0.4763826 )
  sigma=10 kernel=rbfdot lambda=10 nblocks=4 ( 0.4220485 )
  sigma=100 kernel=rbfdot lambda=10 nblocks=4 ( 0.4692643 )
  sigma=1000 kernel=rbfdot lambda=10 nblocks=4 ( 0.4896417 )
  sigma=10000 kernel=rbfdot lambda=10 nblocks=4 ( 0.4928162 )
  sigma=0.001 kernel=rbfdot lambda=100 nblocks=4 ( 0.4937154 )
  sigma=0.01 kernel=rbfdot lambda=100 nblocks=4 ( 0.4938241 )
  sigma=0.1 kernel=rbfdot lambda=100 nblocks=4 ( 0.4940912 )
  sigma=1 kernel=rbfdot lambda=100 nblocks=4 ( 0.491273 )
  sigma=10 kernel=rbfdot lambda=100 nblocks=4 ( 0.4843438 )
  sigma=100 kernel=rbfdot lambda=100 nblocks=4 ( 0.4902862 )
  sigma=1000 kernel=rbfdot lambda=100 nblocks=4 ( 0.4926079 )
  sigma=10000 kernel=rbfdot lambda=100 nblocks=4 ( 0.4929572 )
  predictors:  PC1 dependent:  PC2 
  sigma=0.001 kernel=rbfdot lambda=0 nblocks=4 ( 13289.07 )
  sigma=0.01 kernel=rbfdot lambda=0 nblocks=4 ( 3501.177 )
  sigma=0.1 kernel=rbfdot lambda=0 nblocks=4 ( 242281.1 )
  sigma=1 kernel=rbfdot lambda=0 nblocks=4 ( 2.703438e+13 )
  sigma=10 kernel=rbfdot lambda=0 nblocks=4 ( 17820555930 )
  Error in solve(Matrix(K + diag(lambda, N))) : 
    Lapack dgecon(): system computationally singular, reciprocal condition number = 1.31517e-16
  sigma=100 kernel=rbfdot lambda=0 nblocks=4 ( NA )
  sigma=1000 kernel=rbfdot lambda=0 nblocks=4 ( 1249119944 )
  sigma=10000 kernel=rbfdot lambda=0 nblocks=4 ( 50.75035 )
  sigma=0.001 kernel=rbfdot lambda=0.001 nblocks=4 ( 2.178104 )
  sigma=0.01 kernel=rbfdot lambda=0.001 nblocks=4 ( 2.18271 )
  sigma=0.1 kernel=rbfdot lambda=0.001 nblocks=4 ( 2.196971 )
  sigma=1 kernel=rbfdot lambda=0.001 nblocks=4 ( 2.119601 )
  sigma=10 kernel=rbfdot lambda=0.001 nblocks=4 ( 2.434943 )
  sigma=100 kernel=rbfdot lambda=0.001 nblocks=4 ( 4.578474 )
  sigma=1000 kernel=rbfdot lambda=0.001 nblocks=4 ( 3.80578 )
  sigma=10000 kernel=rbfdot lambda=0.001 nblocks=4 ( 2.752334 )
  sigma=0.001 kernel=rbfdot lambda=0.01 nblocks=4 ( 2.176996 )
  sigma=0.01 kernel=rbfdot lambda=0.01 nblocks=4 ( 2.184469 )
  sigma=0.1 kernel=rbfdot lambda=0.01 nblocks=4 ( 2.189605 )
  sigma=1 kernel=rbfdot lambda=0.01 nblocks=4 ( 2.119295 )
  sigma=10 kernel=rbfdot lambda=0.01 nblocks=4 ( 2.200343 )
  sigma=100 kernel=rbfdot lambda=0.01 nblocks=4 ( 2.654265 )
  sigma=1000 kernel=rbfdot lambda=0.01 nblocks=4 ( 2.766585 )
  sigma=10000 kernel=rbfdot lambda=0.01 nblocks=4 ( 2.343244 )
  sigma=0.001 kernel=rbfdot lambda=0.1 nblocks=4 ( 2.175796 )
  sigma=0.01 kernel=rbfdot lambda=0.1 nblocks=4 ( 2.177757 )
  sigma=0.1 kernel=rbfdot lambda=0.1 nblocks=4 ( 2.18258 )
  sigma=1 kernel=rbfdot lambda=0.1 nblocks=4 ( 2.128119 )
  sigma=10 kernel=rbfdot lambda=0.1 nblocks=4 ( 2.18845 )
  sigma=100 kernel=rbfdot lambda=0.1 nblocks=4 ( 2.35181 )
  sigma=1000 kernel=rbfdot lambda=0.1 nblocks=4 ( 2.263894 )
  sigma=10000 kernel=rbfdot lambda=0.1 nblocks=4 ( 2.211577 )
  sigma=0.001 kernel=rbfdot lambda=1 nblocks=4 ( 2.169365 )
  sigma=0.01 kernel=rbfdot lambda=1 nblocks=4 ( 2.175571 )
  sigma=0.1 kernel=rbfdot lambda=1 nblocks=4 ( 2.182475 )
  sigma=1 kernel=rbfdot lambda=1 nblocks=4 ( 2.15292 )
  sigma=10 kernel=rbfdot lambda=1 nblocks=4 ( 2.098597 )
  sigma=100 kernel=rbfdot lambda=1 nblocks=4 ( 2.119467 )
  sigma=1000 kernel=rbfdot lambda=1 nblocks=4 ( 2.133807 )
  sigma=10000 kernel=rbfdot lambda=1 nblocks=4 ( 2.144122 )
  sigma=0.001 kernel=rbfdot lambda=10 nblocks=4 ( 2.166461 )
  sigma=0.01 kernel=rbfdot lambda=10 nblocks=4 ( 2.168966 )
  sigma=0.1 kernel=rbfdot lambda=10 nblocks=4 ( 2.175226 )
  sigma=1 kernel=rbfdot lambda=10 nblocks=4 ( 2.16905 )
  sigma=10 kernel=rbfdot lambda=10 nblocks=4 ( 2.112152 )
  sigma=100 kernel=rbfdot lambda=10 nblocks=4 ( 2.115018 )
  sigma=1000 kernel=rbfdot lambda=10 nblocks=4 ( 2.13619 )
  sigma=10000 kernel=rbfdot lambda=10 nblocks=4 ( 2.152397 )
  sigma=0.001 kernel=rbfdot lambda=100 nblocks=4 ( 2.164735 )
  sigma=0.01 kernel=rbfdot lambda=100 nblocks=4 ( 2.165112 )
  sigma=0.1 kernel=rbfdot lambda=100 nblocks=4 ( 2.166818 )
  sigma=1 kernel=rbfdot lambda=100 nblocks=4 ( 2.165647 )
  sigma=10 kernel=rbfdot lambda=100 nblocks=4 ( 2.152936 )
  sigma=100 kernel=rbfdot lambda=100 nblocks=4 ( 2.154229 )
  sigma=1000 kernel=rbfdot lambda=100 nblocks=4 ( 2.159362 )
  sigma=10000 kernel=rbfdot lambda=100 nblocks=4 ( 2.161879 )
  trace= 0 
  predictors:  PC1 PC2 PC3 dependent:  PC4 
  Error in solve(Matrix(K + diag(lambda, N))) : 
    Lapack routine dsytrf returned error code 21
  sigma=0.001 kernel=rbfdot lambda=0 nblocks=4 ( NA )
  sigma=0.01 kernel=rbfdot lambda=0 nblocks=4 ( 6.569145e+12 )
  sigma=0.1 kernel=rbfdot lambda=0 nblocks=4 ( 4.737292e+15 )
  sigma=1 kernel=rbfdot lambda=0 nblocks=4 ( 1.280927e+23 )
  sigma=10 kernel=rbfdot lambda=0 nblocks=4 ( 0.02347867 )
  Error in solve(Matrix(K + diag(lambda, N))) : 
    Lapack dgecon(): system computationally singular, reciprocal condition number = 0
  sigma=100 kernel=rbfdot lambda=0 nblocks=4 ( NA )
  Error in LU.dgC(a) : cs_lu(A) failed: near-singular A (or out of memory)
  sigma=1000 kernel=rbfdot lambda=0 nblocks=4 ( NA )
  Error in LU.dgC(a) : cs_lu(A) failed: near-singular A (or out of memory)
  sigma=10000 kernel=rbfdot lambda=0 nblocks=4 ( NA )
  sigma=0.001 kernel=rbfdot lambda=0.001 nblocks=4 ( 0.02740259 )
  sigma=0.01 kernel=rbfdot lambda=0.001 nblocks=4 ( 0.02627739 )
  sigma=0.1 kernel=rbfdot lambda=0.001 nblocks=4 ( 0.03434927 )
  sigma=1 kernel=rbfdot lambda=0.001 nblocks=4 ( 0.04098847 )
  sigma=10 kernel=rbfdot lambda=0.001 nblocks=4 ( 0.02421226 )
  sigma=100 kernel=rbfdot lambda=0.001 nblocks=4 ( 0.02369899 )
  sigma=1000 kernel=rbfdot lambda=0.001 nblocks=4 ( 0.02367448 )
  sigma=10000 kernel=rbfdot lambda=0.001 nblocks=4 ( 0.02367483 )
  sigma=0.001 kernel=rbfdot lambda=0.01 nblocks=4 ( 0.02549178 )
  sigma=0.01 kernel=rbfdot lambda=0.01 nblocks=4 ( 0.02604561 )
  sigma=0.1 kernel=rbfdot lambda=0.01 nblocks=4 ( 0.02747797 )
  sigma=1 kernel=rbfdot lambda=0.01 nblocks=4 ( 0.02666132 )
  sigma=10 kernel=rbfdot lambda=0.01 nblocks=4 ( 0.0231598 )
  sigma=100 kernel=rbfdot lambda=0.01 nblocks=4 ( 0.02371731 )
  sigma=1000 kernel=rbfdot lambda=0.01 nblocks=4 ( 0.0236745 )
  sigma=10000 kernel=rbfdot lambda=0.01 nblocks=4 ( 0.02367484 )
  sigma=0.001 kernel=rbfdot lambda=0.1 nblocks=4 ( 0.02435503 )
  sigma=0.01 kernel=rbfdot lambda=0.1 nblocks=4 ( 0.02499804 )
  sigma=0.1 kernel=rbfdot lambda=0.1 nblocks=4 ( 0.02447886 )
  sigma=1 kernel=rbfdot lambda=0.1 nblocks=4 ( 0.02355697 )
  sigma=10 kernel=rbfdot lambda=0.1 nblocks=4 ( 0.02340593 )
  sigma=100 kernel=rbfdot lambda=0.1 nblocks=4 ( 0.02370406 )
  sigma=1000 kernel=rbfdot lambda=0.1 nblocks=4 ( 0.02367462 )
  sigma=10000 kernel=rbfdot lambda=0.1 nblocks=4 ( 0.02367493 )
  sigma=0.001 kernel=rbfdot lambda=1 nblocks=4 ( 0.02406544 )
  sigma=0.01 kernel=rbfdot lambda=1 nblocks=4 ( 0.02428398 )
  sigma=0.1 kernel=rbfdot lambda=1 nblocks=4 ( 0.02462322 )
  sigma=1 kernel=rbfdot lambda=1 nblocks=4 ( 0.02327056 )
  sigma=10 kernel=rbfdot lambda=1 nblocks=4 ( 0.02332962 )
  sigma=100 kernel=rbfdot lambda=1 nblocks=4 ( 0.02368433 )
  sigma=1000 kernel=rbfdot lambda=1 nblocks=4 ( 0.02367529 )
  sigma=10000 kernel=rbfdot lambda=1 nblocks=4 ( 0.02367546 )
  sigma=0.001 kernel=rbfdot lambda=10 nblocks=4 ( 0.02389366 )
  sigma=0.01 kernel=rbfdot lambda=10 nblocks=4 ( 0.02393029 )
  sigma=0.1 kernel=rbfdot lambda=10 nblocks=4 ( 0.02408474 )
  sigma=1 kernel=rbfdot lambda=10 nblocks=4 ( 0.02342388 )
  sigma=10 kernel=rbfdot lambda=10 nblocks=4 ( 0.02356834 )
  sigma=100 kernel=rbfdot lambda=10 nblocks=4 ( 0.02367638 )
  sigma=1000 kernel=rbfdot lambda=10 nblocks=4 ( 0.02367602 )
  sigma=10000 kernel=rbfdot lambda=10 nblocks=4 ( 0.02367605 )
  sigma=0.001 kernel=rbfdot lambda=100 nblocks=4 ( 0.02373598 )
  sigma=0.01 kernel=rbfdot lambda=100 nblocks=4 ( 0.02373896 )
  sigma=0.1 kernel=rbfdot lambda=100 nblocks=4 ( 0.02374232 )
  sigma=1 kernel=rbfdot lambda=100 nblocks=4 ( 0.02364742 )
  sigma=10 kernel=rbfdot lambda=100 nblocks=4 ( 0.0236628 )
  sigma=100 kernel=rbfdot lambda=100 nblocks=4 ( 0.0236762 )
  sigma=1000 kernel=rbfdot lambda=100 nblocks=4 ( 0.02367617 )
  sigma=10000 kernel=rbfdot lambda=100 nblocks=4 ( 0.02367618 )
  predictors:  PC1 PC2 dependent:  PC3 
  sigma=0.001 kernel=rbfdot lambda=0 nblocks=4 ( 5351356 )
  sigma=0.01 kernel=rbfdot lambda=0 nblocks=4 ( 9018991 )
  sigma=0.1 kernel=rbfdot lambda=0 nblocks=4 ( 45644794 )
  sigma=1 kernel=rbfdot lambda=0 nblocks=4 ( 45.3141 )
  sigma=10 kernel=rbfdot lambda=0 nblocks=4 ( 0.07994985 )
  sigma=100 kernel=rbfdot lambda=0 nblocks=4 ( 0.0738262 )
  Error in .local(a, b, ...) : 
    cs_lu(A) failed: near-singular A (or out of memory)
  sigma=1000 kernel=rbfdot lambda=0 nblocks=4 ( NA )
  Error in LU.dgC(a) : cs_lu(A) failed: near-singular A (or out of memory)
  sigma=10000 kernel=rbfdot lambda=0 nblocks=4 ( NA )
  sigma=0.001 kernel=rbfdot lambda=0.001 nblocks=4 ( 0.0882624 )
  sigma=0.01 kernel=rbfdot lambda=0.001 nblocks=4 ( 0.0823693 )
  sigma=0.1 kernel=rbfdot lambda=0.001 nblocks=4 ( 0.08338067 )
  sigma=1 kernel=rbfdot lambda=0.001 nblocks=4 ( 0.124114 )
  sigma=10 kernel=rbfdot lambda=0.001 nblocks=4 ( 0.08526195 )
  sigma=100 kernel=rbfdot lambda=0.001 nblocks=4 ( 0.07389186 )
  sigma=1000 kernel=rbfdot lambda=0.001 nblocks=4 ( 0.07504289 )
  sigma=10000 kernel=rbfdot lambda=0.001 nblocks=4 ( 0.07548306 )
  sigma=0.001 kernel=rbfdot lambda=0.01 nblocks=4 ( 0.08553556 )
  sigma=0.01 kernel=rbfdot lambda=0.01 nblocks=4 ( 0.08853882 )
  sigma=0.1 kernel=rbfdot lambda=0.01 nblocks=4 ( 0.08169636 )
  sigma=1 kernel=rbfdot lambda=0.01 nblocks=4 ( 0.0859834 )
  sigma=10 kernel=rbfdot lambda=0.01 nblocks=4 ( 0.07879649 )
  sigma=100 kernel=rbfdot lambda=0.01 nblocks=4 ( 0.07391647 )
  sigma=1000 kernel=rbfdot lambda=0.01 nblocks=4 ( 0.0750612 )
  sigma=10000 kernel=rbfdot lambda=0.01 nblocks=4 ( 0.07550018 )
  sigma=0.001 kernel=rbfdot lambda=0.1 nblocks=4 ( 0.08335807 )
  sigma=0.01 kernel=rbfdot lambda=0.1 nblocks=4 ( 0.08629576 )
  sigma=0.1 kernel=rbfdot lambda=0.1 nblocks=4 ( 0.08020493 )
  sigma=1 kernel=rbfdot lambda=0.1 nblocks=4 ( 0.07496502 )
  sigma=10 kernel=rbfdot lambda=0.1 nblocks=4 ( 0.07528756 )
  sigma=100 kernel=rbfdot lambda=0.1 nblocks=4 ( 0.07405866 )
  sigma=1000 kernel=rbfdot lambda=0.1 nblocks=4 ( 0.0752473 )
  sigma=10000 kernel=rbfdot lambda=0.1 nblocks=4 ( 0.07565807 )
  sigma=0.001 kernel=rbfdot lambda=1 nblocks=4 ( 0.08220274 )
  sigma=0.01 kernel=rbfdot lambda=1 nblocks=4 ( 0.08377787 )
  sigma=0.1 kernel=rbfdot lambda=1 nblocks=4 ( 0.08333561 )
  sigma=1 kernel=rbfdot lambda=1 nblocks=4 ( 0.07495852 )
  sigma=10 kernel=rbfdot lambda=1 nblocks=4 ( 0.07386666 )
  sigma=100 kernel=rbfdot lambda=1 nblocks=4 ( 0.07548605 )
  sigma=1000 kernel=rbfdot lambda=1 nblocks=4 ( 0.07626578 )
  sigma=10000 kernel=rbfdot lambda=1 nblocks=4 ( 0.07651293 )
  sigma=0.001 kernel=rbfdot lambda=10 nblocks=4 ( 0.08071893 )
  sigma=0.01 kernel=rbfdot lambda=10 nblocks=4 ( 0.08120809 )
  sigma=0.1 kernel=rbfdot lambda=10 nblocks=4 ( 0.08183408 )
  sigma=1 kernel=rbfdot lambda=10 nblocks=4 ( 0.07777388 )
  sigma=10 kernel=rbfdot lambda=10 nblocks=4 ( 0.07653668 )
  sigma=100 kernel=rbfdot lambda=10 nblocks=4 ( 0.07722217 )
  sigma=1000 kernel=rbfdot lambda=10 nblocks=4 ( 0.07741497 )
  sigma=10000 kernel=rbfdot lambda=10 nblocks=4 ( 0.07746377 )
  sigma=0.001 kernel=rbfdot lambda=100 nblocks=4 ( 0.0785553 )
  sigma=0.01 kernel=rbfdot lambda=100 nblocks=4 ( 0.07857786 )
  sigma=0.1 kernel=rbfdot lambda=100 nblocks=4 ( 0.07858951 )
  sigma=1 kernel=rbfdot lambda=100 nblocks=4 ( 0.07781002 )
  sigma=10 kernel=rbfdot lambda=100 nblocks=4 ( 0.07755034 )
  sigma=100 kernel=rbfdot lambda=100 nblocks=4 ( 0.07763631 )
  sigma=1000 kernel=rbfdot lambda=100 nblocks=4 ( 0.07765804 )
  sigma=10000 kernel=rbfdot lambda=100 nblocks=4 ( 0.07766344 )
  ── 1. Error: rmse_by_ndim (@test_quality.R#30)  ────────────────────────────────
  Lapack dgecon(): system computationally singular, reciprocal condition number = 0
  1: embed(ir, "DRR", ndim = ndims(ir)) at testthat/test_quality.R:30
  2: embed(ir, "DRR", ndim = ndims(ir))
  3: .local(.data, ...)
  4: do.call(methodObject@fun, args)
  5: (function (data, pars, keep.org.data = TRUE) 
     {
         chckpkg("DRR")
         chckpkg("kernlab")
         meta <- data@meta
         orgdata <- if (keep.org.data) 
             data@data
         else NULL
         indata <- data@data
         res <- do.call(DRR::drr, c(list(X = indata), pars))
         outdata <- res$fitted.data
         colnames(outdata) <- paste0("DRR", 1:ncol(outdata))
         appl <- function(x) {
             appl.meta <- if (inherits(x, "dimRedData")) 
                 x@meta
             else data.frame()
             proj <- if (inherits(x, "dimRedData")) 
                 x@data
             else x
             if (ncol(proj) != ncol(data@data)) 
                 stop("x must have the same number of dimensions ", "as the original data")
             appl.out <- new("dimRedData", data = res$apply(proj), meta = appl.meta)
             dimnames(appl.out@data) <- list(rownames(x), paste0("DRR", seq_len(ncol(appl.out@data))))
             return(appl.out)
         }
         inv <- function(x) {
             appl.meta <- if (inherits(x, "dimRedData")) 
                 x@meta
             else data.frame()
             proj <- if (inherits(x, "dimRedData")) 
                 x@data
             else x
             if (ncol(proj) > ncol(data@data)) 
                 stop("x must have less or equal number of dimensions ", "as the original data")
             inv.out <- new("dimRedData", data = res$inverse(proj), meta = appl.meta)
             dimnames(inv.out@data) <- list(rownames(proj), colnames(data@data))
             return(inv.out)
         }
         return(new("dimRedResult", data = new("dimRedData", data = outdata, meta = meta), 
             org.data = orgdata, apply = appl, inverse = inv, has.org.data = keep.org.data, 
             has.apply = TRUE, has.inverse = TRUE, method = "drr", pars = pars))
     })(data = new("dimRedData", data = structure(c(5.1, 4.9, 4.7, 4.6, 5, 5.4, 4.6, 5, 
     4.4, 4.9, 5.4, 4.8, 4.8, 4.3, 5.8, 5.7, 5.4, 5.1, 5.7, 5.1, 5.4, 5.1, 4.6, 5.1, 4.8, 
     5, 5, 5.2, 5.2, 4.7, 4.8, 5.4, 5.2, 5.5, 4.9, 5, 5.5, 4.9, 4.4, 5.1, 5, 4.5, 4.4, 
     5, 5.1, 4.8, 5.1, 4.6, 5.3, 5, 7, 6.4, 6.9, 5.5, 6.5, 5.7, 6.3, 4.9, 6.6, 5.2, 5, 
     5.9, 6, 6.1, 5.6, 6.7, 5.6, 5.8, 6.2, 5.6, 5.9, 6.1, 6.3, 6.1, 6.4, 6.6, 6.8, 6.7, 
     6, 5.7, 5.5, 5.5, 5.8, 6, 5.4, 6, 6.7, 6.3, 5.6, 5.5, 5.5, 6.1, 5.8, 5,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 1, 1.4, 
     1.3, 1.4, 1.5, 1, 1.5, 1.1, 1.8, 1.3, 1.5, 1.2, 1.3, 1.4, 1.4, 1.7, 1.5, 1, 1.1, 
     1, 1.2, 1.6, 1.5, 1.6, 1.5, 1.3, 1.3, 1.3, 1.2, 1.4, 1.2, 1, 1.3, 1.2, 1.3, 1.3, 
     1.1, 1.3, 2.5, 1.9, 2.1, 1.8, 2.2, 2.1, 1.7, 1.8, 1.8, 2.5, 2, 1.9, 2.1, 2, 2.4, 
     2.3, 1.8, 2.2, 2.3, 1.5, 2.3, 2, 2, 1.8, 2.1, 1.8, 1.8, 1.8, 2.1, 1.6, 1.9, 2, 2.2, 
     1.5, 1.4, 2.3, 2.4, 1.8, 1.8, 2.1, 2.4, 2.3, 1.9, 2.3, 2.5, 2.3, 1.9, 2, 2.3, 1.8
     ), .Dim = c(150L, 4L), .Dimnames = list(NULL, c("Sepal.Length", "Sepal.Width", "Petal.Length", 
     "Petal.Width"))), meta = structure(list(Species = structure(c(1L, 1L, 1L, 1L, 1L, 
     1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
     1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
     1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 
     2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 
     2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 
     3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 
     3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L), .Label = c("setosa", 
     "versicolor", "virginica"), class = "factor")), class = "data.frame", row.names = c(NA, 
     -150L))), keep.org.data = TRUE, pars = list(ndim = 4L, lambda = c(0, 0.001, 0.01, 
     0.1, 1, 10, 100), kernel = "rbfdot", kernel.pars = list(sigma = c(0.001, 0.01, 0.1, 
     1, 10, 100, 1000, 10000)), pca = TRUE, pca.center = TRUE, pca.scale = FALSE, fastcv = FALSE, 
         cv.folds = 5, fastcv.test = NULL, fastkrr.nblocks = 4, verbose = TRUE))
  6: do.call(DRR::drr, c(list(X = indata), pars))
  7: (function (X, ndim = ncol(X), lambda = c(0, 10^(-3:2)), kernel = "rbfdot", kernel.pars = list(sigma = 10^(-3:4)), 
         pca = TRUE, pca.center = TRUE, pca.scale = FALSE, fastcv = FALSE, cv.folds = 5, 
         fastcv.test = NULL, fastkrr.nblocks = 4, verbose = TRUE) 
     {
         if ((!fastcv) && (cv.folds <= 1)) 
             stop("need more than one fold for crossvalidation")
         if (cv.folds%%1 != 0) 
             stop("cv.folds must be an integer")
         if (fastkrr.nblocks < 1) 
             stop("fastkrr.nblocks must be > 1")
         if (fastkrr.nblocks%%1 != 0) 
             stop("fastkrr.nblocks must be an integer")
         if (!requireNamespace("CVST")) 
             stop("require the 'CVST' package")
         if (!requireNamespace("kernlab")) 
             stop("require 'kernlab' package")
         if (ndim < ncol(X)) 
             warning("ndim < data dimensionality, ", "the inverse functions will be incomplete!")
         devnull <- if (Sys.info()["sysname"] != "Windows") 
             "/dev/null"
         else "NUL"
         if (!verbose) {
             devnull1 <- file(devnull, "wt")
             sink(devnull1, type = "message")
             on.exit({
                 sink(file = NULL, type = "message")
                 close(devnull1)
             }, add = TRUE)
         }
         if (!verbose) {
             devnull2 <- file(devnull, "wt")
             sink(devnull2, type = "output")
             on.exit({
                 sink()
                 close(devnull2)
             }, add = TRUE)
         }
         if (ndim > ncol(X)) 
             ndim <- ncol(X)
         if (pca) {
             pca <- stats::prcomp(X, center = pca.center, scale. = pca.scale)
             if (!pca.center) 
                 pca$center <- rep(0, ncol(X))
             if (!pca.scale) 
                 pca$scale <- rep(1, ncol(X))
         }
         else {
             pca <- list()
             pca$x <- X
             pca$rotation <- diag(1, ncol(X), ncol(X))
             pca$center <- rep(0, ncol(X))
             pca$scale <- rep(1, ncol(X))
         }
         alpha <- pca$x
         d <- ndim
         kpars <- kernel.pars
         kpars$kernel <- kernel
         kpars$lambda <- lambda
         kpars$nblocks <- fastkrr.nblocks
         krrl <- constructFastKRRLearner()
         p <- do.call(CVST::constructParams, kpars)
         Y <- matrix(NA_real_, nrow = nrow(X), ncol = d)
         models <- list()
         if (d > 1) 
             for (i in d:2) {
                 message(Sys.time(), ": Constructing Axis ", d - i + 1, "/", d)
                 data <- CVST::constructData(x = alpha[, 1:(i - 1), drop = FALSE], y = alpha[, 
                     i])
                 cat("predictors: ", colnames(alpha)[1:(i - 1)], "dependent: ", colnames(alpha)[i], 
                     "\n")
                 res <- if (fastcv) {
                     CVST::fastCV(data, krrl, p, CVST::constructCVSTModel(), test = fastcv.test, 
                       verbose = verbose)
                 }
                 else {
                     CVST::CV(data, krrl, p, fold = cv.folds, verbose = verbose)
                 }
                 model <- krrl$learn(data, res[[1]])
                 models[[i]] <- model
                 Y[, i] <- as.matrix(alpha[, i] - krrl$predict(model, data))
             }
         message(Sys.time(), ": Constructing Axis ", d, "/", d)
         Y[, 1] <- alpha[, 1]
         models[[1]] <- list()
         appl <- function(x) {
             dat <- scale(x, pca$center, pca$scale)
             dat <- dat %*% pca$rotation
             outdat <- matrix(NA_real_, ncol = d, nrow = nrow(x))
             if (d > 1) 
                 for (i in d:2) outdat[, i] <- dat[, i] - krrl$predict(models[[i]], CVST::constructData(x = dat[, 
                     1:(i - 1), drop = FALSE], y = NA))
             outdat[, 1] <- dat[, 1]
             return(outdat)
         }
         inv <- function(x) {
             dat <- cbind(x, matrix(0, nrow(x), ncol(X) - ncol(x)))
             outdat <- dat
             if (d > 1) 
                 for (i in 2:d) outdat[, i] <- dat[, i] + krrl$predict(models[[i]], CVST::constructData(x = outdat[, 
                     1:(i - 1), drop = FALSE], y = NA))
             outdat <- outdat %*% t(pca$rotation)
             outdat <- sweep(outdat, 2L, pca$scale, "*")
             outdat <- sweep(outdat, 2L, pca$center, "+")
             return(outdat)
         }
         return(list(fitted.data = Y, pca.means = pca$center, pca.scale = pca$scale, pca.rotation = pca$rotation, 
             models = models, apply = appl, inverse = inv))
     })(X = structure(c(5.1, 4.9, 4.7, 4.6, 5, 5.4, 4.6, 5, 4.4, 4.9, 5.4, 4.8, 4.8, 4.3, 
     5.8, 5.7, 5.4, 5.1, 5.7, 5.1, 5.4, 5.1, 4.6, 5.1, 4.8, 5, 5, 5.2, 5.2, 4.7, 4.8, 
     5.4, 5.2, 5.5, 4.9, 5, 5.5, 4.9, 4.4, 5.1, 5, 4.5, 4.4, 5, 5.1, 4.8, 5.1, 4.6, 5.3, 
     5, 7, 6.4, 6.9, 5.5, 6.5, 5.7, 6.3, 4.9, 6.6, 5.2, 5, 5.9, 6, 6.1, 5.6, 6.7, 5.6, 
     5.8, 6.2, 5.6, 5.9, 6.1, 6.3, 6.1, 6.4, 6.6, 6.8, 6.7, 6, 5.7, 5.5, 5.5, 5.8, 6, 
     5.4, 6, 6.7, 6.3, 5.6, 5.5, 5.5, 6.1, 5.8, 5, 5.6, 5.7, 5.7, 6.2, 5.1, 5.7, 6.3, 
     5.8, 7.1, 6.3, 6.5, 7.6, 4.9, 7.3, 6.7, 7.2, 6.5, 6.4, 6.8, 5.7, 5.8, 6.4, 6.5, 7.7, 
     7.7, 6, 6.9, 5.6, 7.7, 6.3, 6.7, 7.2, 6.2, 6.1, 6.4, 7.2, 7.4, 7.9, 6.4, 6.3, 6.1, 
     7.7, 6.3, 6.4, 6, 6.9, 6.7, 6.9, 5.8, 6.8,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 2.4, 2.3, 1.8, 2.2, 2.3, 
     1.5, 2.3, 2, 2, 1.8, 2.1, 1.8, 1.8, 1.8, 2.1, 1.6, 1.9, 2, 2.2, 1.5, 1.4, 2.3, 2.4, 
     1.8, 1.8, 2.1, 2.4, 2.3, 1.9, 2.3, 2.5, 2.3, 1.9, 2, 2.3, 1.8), .Dim = c(150L, 4L
     ), .Dimnames = list(NULL, c("Sepal.Length", "Sepal.Width", "Petal.Length", "Petal.Width"
     ))), ndim = 4L, lambda = c(0, 0.001, 0.01, 0.1, 1, 10, 100), kernel = "rbfdot", kernel.pars = list(
         sigma = c(0.001, 0.01, 0.1, 1, 10, 100, 1000, 10000)), pca = TRUE, pca.center = TRUE, 
         pca.scale = FALSE, fastcv = FALSE, cv.folds = 5, fastcv.test = NULL, fastkrr.nblocks = 4, 
         verbose = TRUE)
  8: krrl$learn(data, res[[1]])
  9: krr(data$x[i_indices, ], kernel, data$y[i_indices], params$lambda)
  10: solve(Matrix(K + diag(lambda, N)))
  11: solve(Matrix(K + diag(lambda, N)))
  
  ══ testthat results  ═══════════════════════════════════════════════════════════
  OK: 110 SKIPPED: 0 FAILED: 1
  1. Error: rmse_by_ndim (@test_quality.R#30) 
  
  Error: testthat unit tests failed
  Execution halted