Running ‘test-all.R’ [11s/16s]
Running the tests in ‘tests/test-all.R’ failed.
Complete output:
  > library(testthat)
  > test_check("letsR")
  Loading required package: letsR
  Loading required package: raster
  Loading required package: sp
  Loading required package: maps
  ── 1. Failure: Other parameters work (@test-TimLucas.r#76)  ────────────────────
  class(PresAbMat4) not equal to "matrix".
  Lengths differ: 2 is not 1
  
  ── 2. Failure: lets.addpoly works fine, onlyvar = FALSE (@test-lets_addpoly.R#11
  class(resu_test) not equal to "matrix".
  Lengths differ: 2 is not 1
  
  ── 3. Failure: lets.addpoly works fine, onlyvar = TRUE (@test-lets_addpoly.R#18)
  class(resu_test) not equal to "matrix".
  Lengths differ: 2 is not 1
  
  Error in x$.self$finalize() : attempt to apply non-function
  ── 4. Failure: lets.addvar works fine (@test-lets_addvar.R#11)  ────────────────
  class(PAM_temp_mean) == "matrix" isn't true.
  
  ── 5. Failure: lets.addvar works fine, different fun (@test-lets_addvar.R#20)  ─
  class(PAM_temp_mean) == "matrix" isn't true.
  
  ── 6. Failure: lets.addvar works fine, onlyvar = TRUE (@test-lets_addvar.R#29)  
  class(PAM_temp_mean) == "matrix" isn't true.
  
  ── 7. Failure: lets.addvar works fine, multiple rasters (@test-lets_addvar.R#38)
  class(PAM_temp_mean) == "matrix" isn't true.
  
  ── 8. Failure: lets.addpoly lets.classvar fine (@test-lets_classvar.R#13)  ─────
  class(resu_test) not equal to "matrix".
  Lengths differ: 2 is not 1
  
  ── 9. Failure: lets.addpoly lets.classvar fine, xy = FALSE (@test-lets_classvar.
  class(resu_test) not equal to "matrix".
  Lengths differ: 2 is not 1
  
  ── 10. Failure: lets.addpoly lets.classvar fine, set groups (@test-lets_classvar
  class(resu_test) not equal to "matrix".
  Lengths differ: 2 is not 1
  
   ----------- FAILURE REPORT -------------- 
   --- failure: the condition has length > 1 ---
   --- srcref --- 
  : 
   --- package (from environment) --- 
  letsR
   --- call from context --- 
  lets.distmat(PAM[[1]][1:N, 1:2])
   --- call from argument --- 
  if (class(xy) == "PresenceAbsence") {
      xy <- xy[[1]][, 1:2]
  }
   --- R stacktrace ---
  where 1 at testthat/test-lets_correl.R#5: lets.distmat(PAM[[1]][1:N, 1:2])
  where 2: eval(code, test_env)
  where 3: eval(code, test_env)
  where 4: withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error)
  where 5: doTryCatch(return(expr), name, parentenv, handler)
  where 6: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 7: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 8: doTryCatch(return(expr), name, parentenv, handler)
  where 9: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 10: tryCatchList(expr, classes, parentenv, handlers)
  where 11: tryCatch(withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error), error = handle_fatal, 
      skip = function(e) {
      })
  where 12: test_code(NULL, exprs, env)
  where 13: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
  where 14: force(code)
  where 15: doWithOneRestart(return(expr), restart)
  where 16: withOneRestart(expr, restarts[[1L]])
  where 17: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 18: with_reporter(reporter = reporter, start_end_reporter = start_end_reporter, 
      {
          reporter$start_file(basename(path))
          lister$start_file(basename(path))
          source_file(path, new.env(parent = env), chdir = TRUE, 
              wrap = wrap)
          reporter$.end_context()
          reporter$end_file()
      })
  where 19: FUN(X[[i]], ...)
  where 20: lapply(paths, test_file, env = env, reporter = current_reporter, 
      start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
  where 21: force(code)
  where 22: doWithOneRestart(return(expr), restart)
  where 23: withOneRestart(expr, restarts[[1L]])
  where 24: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 25: with_reporter(reporter = current_reporter, results <- lapply(paths, 
      test_file, env = env, reporter = current_reporter, start_end_reporter = FALSE, 
      load_helpers = FALSE, wrap = wrap))
  where 26: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 27: test_dir(path = test_path, reporter = reporter, env = env, filter = filter, 
      ..., stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning, 
      wrap = wrap)
  where 28: test_package_dir(package = package, test_path = test_path, filter = filter, 
      reporter = reporter, ..., stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 29: test_check("letsR")
  
   --- value of length: 2 type: logical ---
  [1] FALSE FALSE
   --- function from context --- 
  function (xy, asdist = TRUE, ...) 
  {
      if (class(xy) == "PresenceAbsence") {
          xy <- xy[[1]][, 1:2]
      }
      if (exists("miles")) {
          distan <- rdist.earth(xy, miles = FALSE, ...)
      }
      else {
          distan <- rdist.earth(xy, ...)
      }
      diag(distan) <- 0
      if (asdist) {
          distan <- as.dist(distan)
      }
      return(distan)
  }
  <bytecode: 0x55c4e86f27b0>
  <environment: namespace:letsR>
   --- function search by body ---
  Function lets.distmat in namespace letsR has this body.
   ----------- END OF FAILURE REPORT -------------- 
  Fatal error: the condition has length > 1