Running ‘testthat.R’ [34s/36s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(recipes)
  Loading required package: dplyr
  
  Attaching package: 'dplyr'
  
  The following object is masked from 'package:testthat':
  
      matches
  
  The following objects are masked from 'package:stats':
  
      filter, lag
  
  The following objects are masked from 'package:base':
  
      intersect, setdiff, setequal, union
  
  Loading required package: broom
  
  Attaching package: 'recipes'
  
  The following object is masked from 'package:stats':
  
      step
  
  > 
  > test_check(package = "recipes")
  ── 1. Error: printing (@test_isomap.R#47)  ─────────────────────────────────────
  require 'RSpectra' package, install it using install.packages('RSpectra')
  1: expect_output(prep(im_rec, training = dat1, verbose = TRUE)) at testthat/test_isomap.R:47
  2: quasi_capture(enquo(object), capture_output, label = label)
  3: capture(act$val <- eval_bare(get_expr(quo), get_env(quo)))
  4: capture_output_lines(code, print, width = width)
  5: eval_with_output(code, print = print, width = width)
  6: withr::with_output_sink(temp, withVisible(code))
  7: force(code)
  8: withVisible(code)
  9: eval_bare(get_expr(quo), get_env(quo))
  10: prep(im_rec, training = dat1, verbose = TRUE)
  11: prep.recipe(im_rec, training = dat1, verbose = TRUE)
  12: prep(x$steps[[i]], training = training, info = x$term_info)
  13: prep.step_isomap(x$steps[[i]], training = training, info = x$term_info)
  14: embed(dimRedData(as.data.frame(training[, col_names, drop = FALSE])), "Isomap", knn = x$options$knn, 
         ndim = x$num, .mute = x$options$.mute)
  15: embed(dimRedData(as.data.frame(training[, col_names, drop = FALSE])), "Isomap", knn = x$options$knn, 
         ndim = x$num, .mute = x$options$.mute)
  16: .local(.data, ...)
  17: do.call(methodObject@fun, args)
  18: (function (data, pars, keep.org.data = TRUE) 
     {
         chckpkg("RSpectra")
         chckpkg("igraph")
         chckpkg("RANN")
         message(Sys.time(), ": Isomap START")
         meta <- data@meta
         orgdata <- if (keep.org.data) 
             data@data
         else NULL
         indata <- data@data
         if (is.null(pars$eps)) 
             pars$eps <- 0
         if (is.null(pars$get_geod)) 
             pars$get_geod <- FALSE
         message(Sys.time(), ": constructing knn graph")
         knng <- makeKNNgraph(x = indata, k = pars$knn, eps = pars$eps)
         message(Sys.time(), ": calculating geodesic distances")
         geodist <- igraph::distances(knng, algorithm = "dijkstra")
         message(Sys.time(), ": Classical Scaling")
         k <- geodist^2
         k <- .Call(stats:::C_DoubleCentre, k)
         k <- -k/2
         e <- RSpectra::eigs_sym(k, pars$ndim, which = "LA", opts = list(retvec = TRUE))
         e_values <- e$values
         e_vectors <- e$vectors
         neig <- sum(e_values > 0)
         if (neig < pars$ndim) {
             warning("Isomap: eigenvalues < 0, returning less dimensions!")
             e_values <- e_values[seq_len(neig)]
             e_vectors <- e_vectors[, seq_len(neig), drop = FALSE]
         }
         e_vectors <- e_vectors * rep(sqrt(e_values), each = nrow(e_vectors))
         colnames(e_vectors) <- paste("iso", seq_len(neig))
         appl <- function(x) {
             message(Sys.time(), ": L-Isomap embed START")
             appl.meta <- if (inherits(x, "dimRedData")) 
                 x@meta
             else data.frame()
             indata <- if (inherits(x, "dimRedData")) 
                 x@data
             else x
             if (ncol(indata) != ncol(data@data)) 
                 stop("x must have the same number of dimensions as the original data")
             nindata <- nrow(indata)
             norg <- nrow(orgdata)
             message(Sys.time(), ": constructing knn graph")
             lknng <- makeKNNgraph(rbind(indata, orgdata), k = pars$knn, eps = pars$eps)
             message(Sys.time(), ": calculating geodesic distances")
             lgeodist <- igraph::distances(lknng, seq_len(nindata), nindata + seq_len(norg))
             message(Sys.time(), ": embedding")
             dammu <- sweep(lgeodist^2, 2, colMeans(geodist^2), "-")
             Lsharp <- sweep(e_vectors, 2, e_values, "/")
             out <- -0.5 * (dammu %*% Lsharp)
             message(Sys.time(), ": DONE")
             return(new("dimRedData", data = out, meta = appl.meta))
         }
         return(new("dimRedResult", data = new("dimRedData", data = e_vectors, meta = meta), 
             org.data = orgdata, has.org.data = keep.org.data, apply = appl, has.apply = TRUE, 
             method = "Isomap", pars = pars, other.data = if (pars$get_geod) list(geod = as.dist(geodist)) else list()))
     })(data = new("dimRedData", data = structure(c(-0.626453810742332, 0.183643324222082, 
     -0.835628612410047, 1.59528080213779, 0.329507771815361, -0.820468384118015, 0.487429052428485, 
     0.738324705129217, 0.575781351653492, -0.305388387156356, 1.51178116845085, 0.389843236411431, 
     -0.621240580541804, -2.2146998871775, 1.12493091814311), .Dim = c(5L, 3L), .Dimnames = list(
         NULL, c("x1", "x2", "x3"))), meta = structure(list(), .Names = character(0), row.names = integer(0), class = "data.frame")), 
         keep.org.data = TRUE, pars = list(knn = 3, ndim = 3, get_geod = FALSE))
  19: chckpkg("RSpectra")
  20: stop(paste0("require '", pkg, "' package, install it using install.packages('", pkg, 
         "')"))
  
  ══ testthat results  ═══════════════════════════════════════════════════════════
  OK: 1016 SKIPPED: 3 FAILED: 1
  1. Error: printing (@test_isomap.R#47) 
  
  Error: testthat unit tests failed
  Execution halted