Running ‘testthat.R’ [61s/56s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(detrendr)
  > 
  > test_check("detrendr")
  ── 1. Error: best_degree works (@test-best_params.R#42)  ───────────────────────
  object of type 'symbol' is not subsettable
  1: suppressWarnings(round(best_degree(img, purpose = "ffs"))) at testthat/test-best_params.R:42
  2: withCallingHandlers(expr, warning = function(w) invokeRestart("muffleWarning"))
  3: best_degree(img, purpose = "ffs")
  4: purrr::map_int(seq_len(d[3]), ~best_degree(img[, , ., ], purpose = purpose, parallel = parallel))
  5: .f(.x[[i]], ...)
  6: best_degree(img[, , ., ], purpose = purpose, parallel = parallel)
  7: cols_detrend_degree_specified_mean_b(sim_mat, upper_degree, purpose = purpose, parallel = parallel)
  8: cols_detrend_degree_specified(mat, degree, purpose = purpose, parallel = parallel) %>% 
         brightness_cols(parallel = parallel) %>% mean(na.rm = TRUE)
  9: eval(lhs, parent, parent)
  10: eval(lhs, parent, parent)
  11: cols_detrend_degree_specified(mat, degree, purpose = purpose, parallel = parallel)
  12: poly_fit_cols(mat, degree, parallel = parallel)
  13: stats::fitted(stats::lm(mat ~ x))
  14: stats::lm(mat ~ x)
  15: eval(mf, parent.frame())
  16: eval(mf, parent.frame())
  17: stats::model.frame(formula = mat ~ x, drop.unused.levels = TRUE)
  18: model.frame.default(formula = mat ~ x, drop.unused.levels = TRUE)
  19: makepredictcall(variables[[i]], vars[[i + 1L]])
  20: makepredictcall.poly(variables[[i]], vars[[i + 1L]])
  21: eval(call[[1L]])
  
  ── 2. Error: detrending works (@test-detrend.R#38)  ────────────────────────────
  task 1 failed - "object of type 'symbol' is not subsettable"
  1: expect_warning(img_detrend_polynom(img, "auto", parallel = 2, purpose = "ff"), "polynomial degree") at testthat/test-detrend.R:38
  2: quasi_capture(enquo(object), capture_warnings, label = label)
  3: capture(act$val <- eval_bare(get_expr(quo), get_env(quo)))
  4: withCallingHandlers(code, warning = function(condition) {
         out$push(condition)
         invokeRestart("muffleWarning")
     })
  5: eval_bare(get_expr(quo), get_env(quo))
  6: img_detrend_polynom(img, "auto", parallel = 2, purpose = "ff")
  7: best_degree(img[, , i, ], purpose = purpose, parallel = parallel)
  8: cols_detrend_degree_specified_mean_b(sim_mat, upper_degree, purpose = purpose, parallel = parallel)
  9: cols_detrend_degree_specified(mat, degree, purpose = purpose, parallel = parallel) %>% 
         brightness_cols(parallel = parallel) %>% mean(na.rm = TRUE)
  10: eval(lhs, parent, parent)
  11: eval(lhs, parent, parent)
  12: cols_detrend_degree_specified(mat, degree, purpose = purpose, parallel = parallel)
  13: poly_fit_cols(mat, degree, parallel = parallel)
  14: foreach::foreach(cols = it, .combine = "cbind") %dopar% {
         stats::fitted(stats::lm(cols ~ x))
     }
  15: e$fun(obj, substitute(ex), parent.frame(), e$data)
  
  ── 3. Error: detrending entire derectories works (@test-dir_detrend.R#81)  ─────
  object of type 'symbol' is not subsettable
  1: purrr::map(orig_imgs, autothresholdr::mean_stack_thresh, method = "tri") %>% purrr::map(~suppressWarnings(img_detrend_polynom(., 
         degree = 2, purpose = "ff"))) at testthat/test-dir_detrend.R:81
  2: withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
  3: eval(quote(`_fseq`(`_lhs`)), env, env)
  4: eval(quote(`_fseq`(`_lhs`)), env, env)
  5: `_fseq`(`_lhs`)
  6: freduce(value, `_function_list`)
  7: withVisible(function_list[[k]](value))
  8: function_list[[k]](value)
  9: purrr::map(., ~suppressWarnings(img_detrend_polynom(., degree = 2, purpose = "ff")))
  10: .f(.x[[i]], ...)
  ...
  23: poly_fit_cols(., degree, parallel = parallel)
  24: stats::fitted(stats::lm(mat ~ x))
  25: stats::lm(mat ~ x)
  26: eval(mf, parent.frame())
  27: eval(mf, parent.frame())
  28: stats::model.frame(formula = mat ~ x, drop.unused.levels = TRUE)
  29: model.frame.default(formula = mat ~ x, drop.unused.levels = TRUE)
  30: makepredictcall(variables[[i]], vars[[i + 1L]])
  31: makepredictcall.poly(variables[[i]], vars[[i + 1L]])
  32: eval(call[[1L]])
  
  ── 4. Error: poly_fits work works (@test-polynom.R#9)  ─────────────────────────
  object of type 'symbol' is not subsettable
  1: expect_equal(poly_fit_cols(mNA, 2), poly_fit_cols(m, 2) %T>% {
         .[, 1] <- NA
     }, check.attributes = FALSE) at testthat/test-polynom.R:9
  2: quasi_label(enquo(object), label)
  3: eval_bare(get_expr(quo), get_env(quo))
  4: poly_fit_cols(mNA, 2)
  5: stats::fitted(stats::lm(mat ~ x))
  6: stats::lm(mat ~ x)
  7: eval(mf, parent.frame())
  8: eval(mf, parent.frame())
  9: stats::model.frame(formula = mat ~ x, drop.unused.levels = TRUE)
  10: model.frame.default(formula = mat ~ x, drop.unused.levels = TRUE)
  11: makepredictcall(variables[[i]], vars[[i + 1L]])
  12: makepredictcall.poly(variables[[i]], vars[[i + 1L]])
  13: eval(call[[1L]])
  
  ══ testthat results  ═══════════════════════════════════════════════════════════
  OK: 194 SKIPPED: 8 FAILED: 4
  1. Error: best_degree works (@test-best_params.R#42) 
  2. Error: detrending works (@test-detrend.R#38) 
  3. Error: detrending entire derectories works (@test-dir_detrend.R#81) 
  4. Error: poly_fits work works (@test-polynom.R#9) 
  
  Error: testthat unit tests failed
  Execution halted