Running 'test-all.R' [71s/78s]
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
  
  -- 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: 0x6fc0df8>
  <environment: namespace:letsR>
   --- function search by body ---
  Function lets.distmat in namespace letsR has this body.
   ----------- END OF FAILURE REPORT -------------- 
  -- 11. Error: (unknown) (@test-lets_correl.R#5)  -------------------------------
  the condition has length > 1
  Backtrace:
   1. letsR::lets.distmat(PAM[[1]][1:N, 1:2])
  
  -- 12. Failure: lets.distmat works fine, asdist = FALSE (@test-lets_distmat.R#22
  class(distPAM) == "matrix" isn't true.
  
   ----------- FAILURE REPORT -------------- 
   --- failure: the condition has length > 1 ---
   --- srcref --- 
  : 
   --- package (from environment) --- 
  letsR
   --- call from context --- 
  lets.distmat(coords, miles = TRUE)
   --- call from argument --- 
  if (class(xy) == "PresenceAbsence") {
      xy <- xy[[1]][, 1:2]
  }
   --- R stacktrace ---
  where 1 at testthat/test-lets_distmat.R#40: lets.distmat(coords, miles = TRUE)
  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(desc, code, env = parent.frame())
  where 13 at testthat/test-lets_distmat.R#37: test_that("lets.distmat works fine, xy as matrix ", {
      distPAM <- lets.distmat(coords, miles = TRUE)
      expect_true(class(distPAM) == "dist")
      expect_true(all(dim(as.matrix(distPAM)) == nrow(coords)))
  })
  where 14: eval(code, test_env)
  where 15: eval(code, test_env)
  where 16: 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 17: doTryCatch(return(expr), name, parentenv, handler)
  where 18: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 19: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 20: doTryCatch(return(expr), name, parentenv, handler)
  where 21: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 22: tryCatchList(expr, classes, parentenv, handlers)
  where 23: 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 24: test_code(NULL, exprs, env)
  where 25: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
  where 26: force(code)
  where 27: doWithOneRestart(return(expr), restart)
  where 28: withOneRestart(expr, restarts[[1L]])
  where 29: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 30: 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 31: FUN(X[[i]], ...)
  where 32: lapply(paths, test_file, env = env, reporter = current_reporter, 
      start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
  where 33: force(code)
  where 34: doWithOneRestart(return(expr), restart)
  where 35: withOneRestart(expr, restarts[[1L]])
  where 36: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 37: 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 38: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 39: 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 40: 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 41: 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: 0x6fc0df8>
  <environment: namespace:letsR>
   --- function search by body ---
  Function lets.distmat in namespace letsR has this body.
   ----------- END OF FAILURE REPORT -------------- 
  -- 13. Error: lets.distmat works fine, xy as matrix  (@test-lets_distmat.R#40)  
  the condition has length > 1
  Backtrace:
   1. letsR::lets.distmat(coords, miles = TRUE)
  
   ----------- FAILURE REPORT -------------- 
   --- failure: the condition has length > 1 ---
   --- srcref --- 
  : 
   --- package (from environment) --- 
  letsR
   --- call from context --- 
  lets.field(PAM[[1]], range, PAM$S, xy = TRUE)
   --- call from argument --- 
  if (class(x) == "PresenceAbsence") {
      p <- x[[1]][, -(1:2)]
      namesSpe <- x[[3]]
  }
   --- R stacktrace ---
  where 1 at testthat/test-lets_field.R#39: lets.field(PAM[[1]], range, PAM$S, xy = TRUE)
  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(desc, code, env = parent.frame())
  where 13 at testthat/test-lets_field.R#36: test_that("lets.field works fine, matrix and xy = TRUE", {
      field <- lets.field(PAM[[1]], range, PAM$S, xy = TRUE)
      expect_equal(class(field), "data.frame")
      expect_true(ncol(field) == 2)
      expect_true(nrow(field) == length(PAM$S))
  })
  where 14: eval(code, test_env)
  where 15: eval(code, test_env)
  where 16: 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 17: doTryCatch(return(expr), name, parentenv, handler)
  where 18: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 19: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 20: doTryCatch(return(expr), name, parentenv, handler)
  where 21: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 22: tryCatchList(expr, classes, parentenv, handlers)
  where 23: 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 24: test_code(NULL, exprs, env)
  where 25: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
  where 26: force(code)
  where 27: doWithOneRestart(return(expr), restart)
  where 28: withOneRestart(expr, restarts[[1L]])
  where 29: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 30: 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 31: FUN(X[[i]], ...)
  where 32: lapply(paths, test_file, env = env, reporter = current_reporter, 
      start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
  where 33: force(code)
  where 34: doWithOneRestart(return(expr), restart)
  where 35: withOneRestart(expr, restarts[[1L]])
  where 36: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 37: 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 38: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 39: 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 40: 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 41: test_check("letsR")
  
   --- value of length: 2 type: logical ---
  [1] FALSE FALSE
   --- function from context --- 
  function (x, y, z, weight = TRUE, xy = NULL, count = FALSE) 
  {
      if (class(x) == "PresenceAbsence") {
          p <- x[[1]][, -(1:2)]
          namesSpe <- x[[3]]
      }
      if (is.matrix(x)) {
          if (is.null(xy)) {
              stop(paste("Please set if your matrix contains ", 
                  "coordinates in the first two columns", "(xy argument)."), 
                  sep = "")
          }
          if (xy) {
              x <- x[, -(1:2)]
          }
          p <- x
          namesSpe <- colnames(x)
      }
      if (is.factor(y)) {
          y <- as.numeric(levels(y))[y]
      }
      p2 <- p
      for (i in 1:ncol(p2)) {
          pos <- z == namesSpe[i]
          if (length(pos) > 0) {
              p2[, i] <- p2[, i] * y[pos]
              pos2 <- p2[, i] == 0
              p2[pos2, i] <- NA
          }
          else {
              p2[, i] <- NA
          }
      }
      media <- numeric(ncol(p))
      n <- length(media)
      if (count) {
          if (!"tools:rstudio" %in% search()) {
              dev.new(width = 2, height = 2, pointsize = 12)
              par(mar = c(0, 0, 0, 0))
          }
          for (i in 1:n) {
              plot.new()
              text(0.5, 0.5, paste(paste("Total:", n, "\n", "Runs to go: ", 
                  (n - i))))
              media[i] <- .InsiLoop(i, p, p2, weight)
          }
          dev.off()
      }
      if (!count) {
          for (i in 1:n) {
              media[i] <- .InsiLoop(i, p, p2, weight)
          }
      }
      resultado <- cbind(namesSpe, media)
      colnames(resultado) <- c("Species", "Value")
      resultado <- as.data.frame(resultado)
      resultado[, 2] <- as.numeric(levels(resultado[, 2]))[resultado[, 
          2]]
      return(resultado)
  }
  <bytecode: 0x6fc31b0>
  <environment: namespace:letsR>
   --- function search by body ---
  Function lets.field in namespace letsR has this body.
   ----------- END OF FAILURE REPORT -------------- 
  -- 14. Error: lets.field works fine, matrix and xy = TRUE (@test-lets_field.R#39
  the condition has length > 1
  Backtrace:
   1. letsR::lets.field(PAM[[1]], range, PAM$S, xy = TRUE)
  
   ----------- FAILURE REPORT -------------- 
   --- failure: the condition has length > 1 ---
   --- srcref --- 
  : 
   --- package (from environment) --- 
  letsR
   --- call from context --- 
  lets.field(PAM[[1]][, -(1:2)], range, PAM$S, xy = FALSE)
   --- call from argument --- 
  if (class(x) == "PresenceAbsence") {
      p <- x[[1]][, -(1:2)]
      namesSpe <- x[[3]]
  }
   --- R stacktrace ---
  where 1 at testthat/test-lets_field.R#50: lets.field(PAM[[1]][, -(1:2)], range, PAM$S, xy = FALSE)
  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(desc, code, env = parent.frame())
  where 13 at testthat/test-lets_field.R#47: test_that("lets.field works fine, matrix and xy = FALSE", {
      field <- lets.field(PAM[[1]][, -(1:2)], range, PAM$S, xy = FALSE)
      expect_equal(class(field), "data.frame")
      expect_true(ncol(field) == 2)
      expect_true(nrow(field) == length(PAM$S))
  })
  where 14: eval(code, test_env)
  where 15: eval(code, test_env)
  where 16: 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 17: doTryCatch(return(expr), name, parentenv, handler)
  where 18: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 19: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 20: doTryCatch(return(expr), name, parentenv, handler)
  where 21: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 22: tryCatchList(expr, classes, parentenv, handlers)
  where 23: 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 24: test_code(NULL, exprs, env)
  where 25: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
  where 26: force(code)
  where 27: doWithOneRestart(return(expr), restart)
  where 28: withOneRestart(expr, restarts[[1L]])
  where 29: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 30: 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 31: FUN(X[[i]], ...)
  where 32: lapply(paths, test_file, env = env, reporter = current_reporter, 
      start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
  where 33: force(code)
  where 34: doWithOneRestart(return(expr), restart)
  where 35: withOneRestart(expr, restarts[[1L]])
  where 36: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 37: 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 38: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 39: 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 40: 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 41: test_check("letsR")
  
   --- value of length: 2 type: logical ---
  [1] FALSE FALSE
   --- function from context --- 
  function (x, y, z, weight = TRUE, xy = NULL, count = FALSE) 
  {
      if (class(x) == "PresenceAbsence") {
          p <- x[[1]][, -(1:2)]
          namesSpe <- x[[3]]
      }
      if (is.matrix(x)) {
          if (is.null(xy)) {
              stop(paste("Please set if your matrix contains ", 
                  "coordinates in the first two columns", "(xy argument)."), 
                  sep = "")
          }
          if (xy) {
              x <- x[, -(1:2)]
          }
          p <- x
          namesSpe <- colnames(x)
      }
      if (is.factor(y)) {
          y <- as.numeric(levels(y))[y]
      }
      p2 <- p
      for (i in 1:ncol(p2)) {
          pos <- z == namesSpe[i]
          if (length(pos) > 0) {
              p2[, i] <- p2[, i] * y[pos]
              pos2 <- p2[, i] == 0
              p2[pos2, i] <- NA
          }
          else {
              p2[, i] <- NA
          }
      }
      media <- numeric(ncol(p))
      n <- length(media)
      if (count) {
          if (!"tools:rstudio" %in% search()) {
              dev.new(width = 2, height = 2, pointsize = 12)
              par(mar = c(0, 0, 0, 0))
          }
          for (i in 1:n) {
              plot.new()
              text(0.5, 0.5, paste(paste("Total:", n, "\n", "Runs to go: ", 
                  (n - i))))
              media[i] <- .InsiLoop(i, p, p2, weight)
          }
          dev.off()
      }
      if (!count) {
          for (i in 1:n) {
              media[i] <- .InsiLoop(i, p, p2, weight)
          }
      }
      resultado <- cbind(namesSpe, media)
      colnames(resultado) <- c("Species", "Value")
      resultado <- as.data.frame(resultado)
      resultado[, 2] <- as.numeric(levels(resultado[, 2]))[resultado[, 
          2]]
      return(resultado)
  }
  <bytecode: 0x6fc31b0>
  <environment: namespace:letsR>
   --- function search by body ---
  Function lets.field in namespace letsR has this body.
   ----------- END OF FAILURE REPORT -------------- 
  -- 15. Error: lets.field works fine, matrix and xy = FALSE (@test-lets_field.R#5
  the condition has length > 1
  Backtrace:
   1. letsR::lets.field(PAM[[1]][, -(1:2)], range, PAM$S, xy = FALSE)
  
   ----------- FAILURE REPORT -------------- 
   --- failure: the condition has length > 1 ---
   --- srcref --- 
  : 
   --- package (from environment) --- 
  letsR
   --- call from context --- 
  lets.field(PAM[[1]], range, PAM$S)
   --- call from argument --- 
  if (class(x) == "PresenceAbsence") {
      p <- x[[1]][, -(1:2)]
      namesSpe <- x[[3]]
  }
   --- R stacktrace ---
  where 1: lets.field(PAM[[1]], range, PAM$S)
  where 2: eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
  where 3: withCallingHandlers({
      code
      NULL
  }, error = function(cnd) {
      if (can_entrace(cnd)) {
          cnd <- cnd_entrace(cnd)
      }
      return_from(env, cnd)
  })
  where 4: .capture(act$val <- eval_bare(quo_get_expr(.quo), quo_get_env(.quo)), 
      ...)
  where 5: quasi_capture(enquo(object), label, capture_error, entrace = TRUE)
  where 6 at testthat/test-lets_field.R#60: expect_error(lets.field(PAM[[1]], range, PAM$S))
  where 7: eval(code, test_env)
  where 8: eval(code, test_env)
  where 9: 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 10: doTryCatch(return(expr), name, parentenv, handler)
  where 11: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 12: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 13: doTryCatch(return(expr), name, parentenv, handler)
  where 14: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 15: tryCatchList(expr, classes, parentenv, handlers)
  where 16: 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 17: test_code(desc, code, env = parent.frame())
  where 18 at testthat/test-lets_field.R#57: test_that("lets.field error expected, matrix without xy", {
      expect_error(lets.field(PAM[[1]], range, PAM$S))
  })
  where 19: eval(code, test_env)
  where 20: eval(code, test_env)
  where 21: 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 22: doTryCatch(return(expr), name, parentenv, handler)
  where 23: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 24: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 25: doTryCatch(return(expr), name, parentenv, handler)
  where 26: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 27: tryCatchList(expr, classes, parentenv, handlers)
  where 28: 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 29: test_code(NULL, exprs, env)
  where 30: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
  where 31: force(code)
  where 32: doWithOneRestart(return(expr), restart)
  where 33: withOneRestart(expr, restarts[[1L]])
  where 34: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 35: 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 36: FUN(X[[i]], ...)
  where 37: lapply(paths, test_file, env = env, reporter = current_reporter, 
      start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
  where 38: force(code)
  where 39: doWithOneRestart(return(expr), restart)
  where 40: withOneRestart(expr, restarts[[1L]])
  where 41: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 42: 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 43: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 44: 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 45: 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 46: test_check("letsR")
  
   --- value of length: 2 type: logical ---
  [1] FALSE FALSE
   --- function from context --- 
  function (x, y, z, weight = TRUE, xy = NULL, count = FALSE) 
  {
      if (class(x) == "PresenceAbsence") {
          p <- x[[1]][, -(1:2)]
          namesSpe <- x[[3]]
      }
      if (is.matrix(x)) {
          if (is.null(xy)) {
              stop(paste("Please set if your matrix contains ", 
                  "coordinates in the first two columns", "(xy argument)."), 
                  sep = "")
          }
          if (xy) {
              x <- x[, -(1:2)]
          }
          p <- x
          namesSpe <- colnames(x)
      }
      if (is.factor(y)) {
          y <- as.numeric(levels(y))[y]
      }
      p2 <- p
      for (i in 1:ncol(p2)) {
          pos <- z == namesSpe[i]
          if (length(pos) > 0) {
              p2[, i] <- p2[, i] * y[pos]
              pos2 <- p2[, i] == 0
              p2[pos2, i] <- NA
          }
          else {
              p2[, i] <- NA
          }
      }
      media <- numeric(ncol(p))
      n <- length(media)
      if (count) {
          if (!"tools:rstudio" %in% search()) {
              dev.new(width = 2, height = 2, pointsize = 12)
              par(mar = c(0, 0, 0, 0))
          }
          for (i in 1:n) {
              plot.new()
              text(0.5, 0.5, paste(paste("Total:", n, "\n", "Runs to go: ", 
                  (n - i))))
              media[i] <- .InsiLoop(i, p, p2, weight)
          }
          dev.off()
      }
      if (!count) {
          for (i in 1:n) {
              media[i] <- .InsiLoop(i, p, p2, weight)
          }
      }
      resultado <- cbind(namesSpe, media)
      colnames(resultado) <- c("Species", "Value")
      resultado <- as.data.frame(resultado)
      resultado[, 2] <- as.numeric(levels(resultado[, 2]))[resultado[, 
          2]]
      return(resultado)
  }
  <bytecode: 0x6fc31b0>
  <environment: namespace:letsR>
   --- function search by body ---
  Function lets.field in namespace letsR has this body.
   ----------- END OF FAILURE REPORT -------------- 
  -- 16. Failure: lets.gridirizer works fine (@test-lets_gridirizer.R#11)  -------
  class(resu_test[[2]]) not equal to "matrix".
  Lengths differ: 2 is not 1
  
  -- 17. Failure: lets.maplizer works fine (@test-lets_maplizer.R#10)  -----------
  class(resu_test) not equal to "matrix".
  Lengths differ: 2 is not 1
  
  -- 18. Failure: lets.maplizer works fine, other func (@test-lets_maplizer.R#17) 
  class(resu_test) not equal to "matrix".
  Lengths differ: 2 is not 1
  
  -- 19. Failure: lets.maplizer works fine (@test-lets_maplizer.R#25)  -----------
  class(resu_test[[1]]) 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(pam2[loc, 1:2], asdist = FALSE)
   --- call from argument --- 
  if (class(xy) == "PresenceAbsence") {
      xy <- xy[[1]][, 1:2]
  }
   --- R stacktrace ---
  where 1: lets.distmat(pam2[loc, 1:2], asdist = FALSE)
  where 2 at testthat/test-lets_midpoint.R#40: lets.midpoint(PAM, method = "CMD")
  where 3: eval(code, test_env)
  where 4: eval(code, test_env)
  where 5: 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 6: doTryCatch(return(expr), name, parentenv, handler)
  where 7: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 8: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 9: doTryCatch(return(expr), name, parentenv, handler)
  where 10: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 11: tryCatchList(expr, classes, parentenv, handlers)
  where 12: 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 13: test_code(desc, code, env = parent.frame())
  where 14 at testthat/test-lets_midpoint.R#37: test_that("lets.midpoint works fine, method = CMD", {
      resu_test <- lets.midpoint(PAM, method = "CMD")
      expect_equal(class(resu_test), "data.frame")
      expect_true(ncol(resu_test) == 3)
      expect_true(!any(is.na(resu_test)))
  })
  where 15: eval(code, test_env)
  where 16: eval(code, test_env)
  where 17: 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 18: doTryCatch(return(expr), name, parentenv, handler)
  where 19: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 20: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 21: doTryCatch(return(expr), name, parentenv, handler)
  where 22: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 23: tryCatchList(expr, classes, parentenv, handlers)
  where 24: 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 25: test_code(NULL, exprs, env)
  where 26: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
  where 27: force(code)
  where 28: doWithOneRestart(return(expr), restart)
  where 29: withOneRestart(expr, restarts[[1L]])
  where 30: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 31: 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 32: FUN(X[[i]], ...)
  where 33: lapply(paths, test_file, env = env, reporter = current_reporter, 
      start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
  where 34: force(code)
  where 35: doWithOneRestart(return(expr), restart)
  where 36: withOneRestart(expr, restarts[[1L]])
  where 37: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 38: 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 39: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 40: 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 41: 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 42: 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: 0x6fc0df8>
  <environment: namespace:letsR>
   --- function search by body ---
  Function lets.distmat in namespace letsR has this body.
   ----------- END OF FAILURE REPORT -------------- 
  -- 20. Error: lets.midpoint works fine, method = CMD (@test-lets_midpoint.R#40) 
  the condition has length > 1
  Backtrace:
   1. letsR::lets.midpoint(PAM, method = "CMD")
   2. letsR::lets.distmat(pam2[loc, 1:2], asdist = FALSE)
  
  -- 21. Failure: lets.overlap works fine, Chesser&Zink (@test-lets_overlap.R#11) 
  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.overlap(PAM[[1]][, -c(1, 2)], method = "Chesser&Zink", xy = FALSE)
   --- call from argument --- 
  if (class(pam) == "PresenceAbsence") {
      pam <- pam[[1]][, -(1:2), drop = FALSE]
  }
   --- R stacktrace ---
  where 1 at testthat/test-lets_overlap.R#20: lets.overlap(PAM[[1]][, -c(1, 2)], method = "Chesser&Zink", xy = FALSE)
  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(desc, code, env = parent.frame())
  where 13 at testthat/test-lets_overlap.R#17: test_that("lets.overlap works fine, xy = FALSE", {
      resu_test <- lets.overlap(PAM[[1]][, -c(1, 2)], method = "Chesser&Zink", 
          xy = FALSE)
      expect_equal(class(resu_test), "matrix")
      expect_true(all(dim(resu_test) == length(PAM[[3]])))
      expect_true(!any(is.na(resu_test)))
  })
  where 14: eval(code, test_env)
  where 15: eval(code, test_env)
  where 16: 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 17: doTryCatch(return(expr), name, parentenv, handler)
  where 18: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 19: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 20: doTryCatch(return(expr), name, parentenv, handler)
  where 21: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 22: tryCatchList(expr, classes, parentenv, handlers)
  where 23: 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 24: test_code(NULL, exprs, env)
  where 25: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
  where 26: force(code)
  where 27: doWithOneRestart(return(expr), restart)
  where 28: withOneRestart(expr, restarts[[1L]])
  where 29: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 30: 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 31: FUN(X[[i]], ...)
  where 32: lapply(paths, test_file, env = env, reporter = current_reporter, 
      start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
  where 33: force(code)
  where 34: doWithOneRestart(return(expr), restart)
  where 35: withOneRestart(expr, restarts[[1L]])
  where 36: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 37: 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 38: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 39: 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 40: 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 41: test_check("letsR")
  
   --- value of length: 2 type: logical ---
  [1] FALSE FALSE
   --- function from context --- 
  function (pam, method = "Chesser&Zink", xy = NULL) 
  {
      methods <- c("Chesser&Zink", "Proportional", "Cells")
      if (!any(method == methods)) {
          stop(paste("The method", method, "is not implemented.", 
              "Please check the spelling."))
      }
      if (!any(class(pam) %in% c("matrix", "PresenceAbsence"))) {
          stop(paste("Object pam should be either a PresenceAbsence or a matrix.\n         Not a", 
              class(pam)))
      }
      if (is.matrix(pam)) {
          if (is.null(xy)) {
              stop(paste("Please set if your matrix contains ", 
                  "coordinates in the first two columns", "(xy argument)."), 
                  sep = "")
          }
          if (xy) {
              pam <- pam[, -(1:2), drop = FALSE]
          }
      }
      if (class(pam) == "PresenceAbsence") {
          pam <- pam[[1]][, -(1:2), drop = FALSE]
      }
      nomes <- colnames(pam)
      n <- ncol(pam)
      resu <- matrix(NA, ncol = n, nrow = n)
      if (method == "Cells") {
          diag(resu) <- 1
          for (i in 1:(n - 1)) {
              for (j in ((i + 1):n)) {
                  over <- sum(rowSums(pam[, c(i, j)]) == 2)
                  resu[i, j] <- over
              }
          }
          ind <- lower.tri(resu)
          resu[ind] <- t(resu)[ind]
      }
      if (method == "Proportional") {
          range <- colSums(pam)
          for (i in 1:n) {
              for (j in 1:n) {
                  over <- sum(rowSums(pam[, c(i, j)]) == 2)
                  if (range[i] == 0) {
                    over2 <- 0
                  }
                  else {
                    over2 <- over/range[i]
                  }
                  resu[i, j] <- over2
              }
          }
      }
      if (method == "Chesser&Zink") {
          range <- colSums(pam)
          diag(resu) <- 1
          for (i in 1:(n - 1)) {
              for (j in ((i + 1):n)) {
                  over <- sum(rowSums(pam[, c(i, j)]) == 2)
                  if (any(range[c(i, j)] %in% 0)) {
                    resu[i, j] <- 0
                  }
                  else {
                    resu[i, j] <- over/min(range[c(i, j)])
                  }
              }
          }
          ind <- lower.tri(resu)
          resu[ind] <- t(resu)[ind]
      }
      colnames(resu) <- nomes
      rownames(resu) <- nomes
      return(resu)
  }
  <bytecode: 0x6f91cc8>
  <environment: namespace:letsR>
   --- function search by body ---
  Function lets.overlap in namespace letsR has this body.
   ----------- END OF FAILURE REPORT -------------- 
  -- 22. Error: lets.overlap works fine, xy = FALSE (@test-lets_overlap.R#20)  ---
  the condition has length > 1
  Backtrace:
   1. letsR::lets.overlap(...)
  
   ----------- FAILURE REPORT -------------- 
   --- failure: the condition has length > 1 ---
   --- srcref --- 
  : 
   --- package (from environment) --- 
  letsR
   --- call from context --- 
  lets.overlap(PAM[[1]], method = "Chesser&Zink", xy = TRUE)
   --- call from argument --- 
  if (class(pam) == "PresenceAbsence") {
      pam <- pam[[1]][, -(1:2), drop = FALSE]
  }
   --- R stacktrace ---
  where 1 at testthat/test-lets_overlap.R#33: lets.overlap(PAM[[1]], method = "Chesser&Zink", xy = TRUE)
  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(desc, code, env = parent.frame())
  where 13 at testthat/test-lets_overlap.R#30: test_that("lets.overlap works fine, xy = TRUE", {
      resu_test <- lets.overlap(PAM[[1]], method = "Chesser&Zink", 
          xy = TRUE)
      expect_equal(class(resu_test), "matrix")
      expect_true(all(dim(resu_test) == length(PAM[[3]])))
      expect_true(!any(is.na(resu_test)))
  })
  where 14: eval(code, test_env)
  where 15: eval(code, test_env)
  where 16: 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 17: doTryCatch(return(expr), name, parentenv, handler)
  where 18: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 19: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 20: doTryCatch(return(expr), name, parentenv, handler)
  where 21: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 22: tryCatchList(expr, classes, parentenv, handlers)
  where 23: 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 24: test_code(NULL, exprs, env)
  where 25: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
  where 26: force(code)
  where 27: doWithOneRestart(return(expr), restart)
  where 28: withOneRestart(expr, restarts[[1L]])
  where 29: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 30: 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 31: FUN(X[[i]], ...)
  where 32: lapply(paths, test_file, env = env, reporter = current_reporter, 
      start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
  where 33: force(code)
  where 34: doWithOneRestart(return(expr), restart)
  where 35: withOneRestart(expr, restarts[[1L]])
  where 36: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 37: 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 38: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 39: 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 40: 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 41: test_check("letsR")
  
   --- value of length: 2 type: logical ---
  [1] FALSE FALSE
   --- function from context --- 
  function (pam, method = "Chesser&Zink", xy = NULL) 
  {
      methods <- c("Chesser&Zink", "Proportional", "Cells")
      if (!any(method == methods)) {
          stop(paste("The method", method, "is not implemented.", 
              "Please check the spelling."))
      }
      if (!any(class(pam) %in% c("matrix", "PresenceAbsence"))) {
          stop(paste("Object pam should be either a PresenceAbsence or a matrix.\n         Not a", 
              class(pam)))
      }
      if (is.matrix(pam)) {
          if (is.null(xy)) {
              stop(paste("Please set if your matrix contains ", 
                  "coordinates in the first two columns", "(xy argument)."), 
                  sep = "")
          }
          if (xy) {
              pam <- pam[, -(1:2), drop = FALSE]
          }
      }
      if (class(pam) == "PresenceAbsence") {
          pam <- pam[[1]][, -(1:2), drop = FALSE]
      }
      nomes <- colnames(pam)
      n <- ncol(pam)
      resu <- matrix(NA, ncol = n, nrow = n)
      if (method == "Cells") {
          diag(resu) <- 1
          for (i in 1:(n - 1)) {
              for (j in ((i + 1):n)) {
                  over <- sum(rowSums(pam[, c(i, j)]) == 2)
                  resu[i, j] <- over
              }
          }
          ind <- lower.tri(resu)
          resu[ind] <- t(resu)[ind]
      }
      if (method == "Proportional") {
          range <- colSums(pam)
          for (i in 1:n) {
              for (j in 1:n) {
                  over <- sum(rowSums(pam[, c(i, j)]) == 2)
                  if (range[i] == 0) {
                    over2 <- 0
                  }
                  else {
                    over2 <- over/range[i]
                  }
                  resu[i, j] <- over2
              }
          }
      }
      if (method == "Chesser&Zink") {
          range <- colSums(pam)
          diag(resu) <- 1
          for (i in 1:(n - 1)) {
              for (j in ((i + 1):n)) {
                  over <- sum(rowSums(pam[, c(i, j)]) == 2)
                  if (any(range[c(i, j)] %in% 0)) {
                    resu[i, j] <- 0
                  }
                  else {
                    resu[i, j] <- over/min(range[c(i, j)])
                  }
              }
          }
          ind <- lower.tri(resu)
          resu[ind] <- t(resu)[ind]
      }
      colnames(resu) <- nomes
      rownames(resu) <- nomes
      return(resu)
  }
  <bytecode: 0x6f91cc8>
  <environment: namespace:letsR>
   --- function search by body ---
  Function lets.overlap in namespace letsR has this body.
   ----------- END OF FAILURE REPORT -------------- 
  -- 23. Error: lets.overlap works fine, xy = TRUE (@test-lets_overlap.R#33)  ----
  the condition has length > 1
  Backtrace:
   1. letsR::lets.overlap(PAM[[1]], method = "Chesser&Zink", xy = TRUE)
  
  -- 24. Failure: lets.overlap works fine, Cells (@test-lets_overlap.R#47)  ------
  class(resu_test) not equal to "matrix".
  Lengths differ: 2 is not 1
  
  -- 25. Failure: lets.overlap works fine, Proportional (@test-lets_overlap.R#57) 
  class(resu_test) not equal to "matrix".
  Lengths differ: 2 is not 1
  
  -- 26. Failure: lets.pamcrop works fine, remove.sp = TRUE (@test-lets_pamcrop.R#
  class(resu_test[[1]]) not equal to "matrix".
  Lengths differ: 2 is not 1
  
  -- 27. Failure: lets.pamcrop works fine, remove.sp = FALSE (@test-lets_pamcrop.R
  class(resu_test[[1]]) not equal to "matrix".
  Lengths differ: 2 is not 1
  
  -- 28. Failure: lets.presab.birds return a correct PresenceAbsence object (@test
  class(PAM[[1]]) not equal to "matrix".
  Lengths differ: 2 is not 1
  
  -- 29. Failure: lets.presab.grid works fine (@test-lets_presab_grid.R#16)  -----
  class(resu[[1]]) not equal to "matrix".
  Lengths differ: 2 is not 1
  
  -- 30. Failure: lets.presab.points return a correct PresenceAbsence object (@tes
  class(PAM[[1]]) not equal to "matrix".
  Lengths differ: 2 is not 1
  
  -- 31. Failure: lets.presab.points return a correct PresenceAbsence object for t
  class(PAM[[1]]) not equal to "matrix".
  Lengths differ: 2 is not 1
  
  -- 32. Failure: lets.presab.points return a correct PresenceAbsence object (coun
  class(PAM[[1]]) not equal to "matrix".
  Lengths differ: 2 is not 1
  
  -- 33. Failure: lets.presab.points return a correct PresenceAbsence object, remo
  class(PAM[[1]]) not equal to "matrix".
  Lengths differ: 2 is not 1
  
  -- 34. Failure: lets.presab.points return a correct PresenceAbsence object, remo
  class(PAM[[1]]) not equal to "matrix".
  Lengths differ: 2 is not 1
  
  -- 35. Failure: lets.rangesize works fine, geographic (@test-lets_rangesize.R#13
  class(resu_test) not equal to "matrix".
  Lengths differ: 2 is not 1
  
  -- 36. Failure: lets.rangesize works fine, planar (@test-lets_rangesize.R#25)  -
  class(resu_test) not equal to "matrix".
  Lengths differ: 2 is not 1
  
  -- 37. Failure: lets.rangesize works fine, squaremeter (@test-lets_rangesize.R#3
  class(resu_test) not equal to "matrix".
  Lengths differ: 2 is not 1
  
  -- 38. Failure: lets.rangesize works fine, squaremeter (@test-lets_rangesize.R#4
  class(resu_test) not equal to "matrix".
  Lengths differ: 2 is not 1
  
  -- 39. Failure: lets.rangesize works fine, squaremeter global (@test-lets_ranges
  class(resu_test) not equal to "matrix".
  Lengths differ: 2 is not 1
  
  -- 40. Failure: lets.subsetPAM works fine, remove.cells = TRUE (@test-lets_subse
  class(resu_test[[1]]) not equal to "matrix".
  Lengths differ: 2 is not 1
  
  -- 41. Failure: lets.subsetPAM works fine, remove.cells = FALSE (@test-lets_subs
  class(resu_test[[1]]) 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.subsetPAM(PAM[[1]], PAM[[3]][1:20])
   --- call from argument --- 
  if (class(x) != "PresenceAbsence") {
      stop("x argument must be a PresenceAbsence object")
  }
   --- R stacktrace ---
  where 1: lets.subsetPAM(PAM[[1]], PAM[[3]][1:20])
  where 2: eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
  where 3: withCallingHandlers({
      code
      NULL
  }, error = function(cnd) {
      if (can_entrace(cnd)) {
          cnd <- cnd_entrace(cnd)
      }
      return_from(env, cnd)
  })
  where 4: .capture(act$val <- eval_bare(quo_get_expr(.quo), quo_get_env(.quo)), 
      ...)
  where 5: quasi_capture(enquo(object), label, capture_error, entrace = TRUE)
  where 6 at testthat/test-lets_subsetPAM.R#39: expect_error(lets.subsetPAM(PAM[[1]], PAM[[3]][1:20]))
  where 7: eval(code, test_env)
  where 8: eval(code, test_env)
  where 9: 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 10: doTryCatch(return(expr), name, parentenv, handler)
  where 11: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 12: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 13: doTryCatch(return(expr), name, parentenv, handler)
  where 14: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 15: tryCatchList(expr, classes, parentenv, handlers)
  where 16: 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 17: test_code(desc, code, env = parent.frame())
  where 18 at testthat/test-lets_subsetPAM.R#36: test_that("lets.subsetPAM error check", {
      expect_error(lets.subsetPAM(PAM, "Bruno"))
      expect_error(lets.subsetPAM(PAM[[1]], PAM[[3]][1:20]))
      expect_error(lets.subsetPAM(PAM, 1))
      expect_error(lets.subsetPAM(PAM[[1]], PAM[[3]][1:20]))
      expect_error(lets.subsetPAM(PAM, PAM[[3]][1:20], 1))
      expect_warning(lets.subsetPAM(PAM, c("Bruno", PAM[[3]][1:20])))
  })
  where 19: eval(code, test_env)
  where 20: eval(code, test_env)
  where 21: 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 22: doTryCatch(return(expr), name, parentenv, handler)
  where 23: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 24: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 25: doTryCatch(return(expr), name, parentenv, handler)
  where 26: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 27: tryCatchList(expr, classes, parentenv, handlers)
  where 28: 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 29: test_code(NULL, exprs, env)
  where 30: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
  where 31: force(code)
  where 32: doWithOneRestart(return(expr), restart)
  where 33: withOneRestart(expr, restarts[[1L]])
  where 34: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 35: 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 36: FUN(X[[i]], ...)
  where 37: lapply(paths, test_file, env = env, reporter = current_reporter, 
      start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
  where 38: force(code)
  where 39: doWithOneRestart(return(expr), restart)
  where 40: withOneRestart(expr, restarts[[1L]])
  where 41: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 42: 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 43: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 44: 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 45: 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 46: test_check("letsR")
  
   --- value of length: 2 type: logical ---
  [1] TRUE TRUE
   --- function from context --- 
  function (x, names, remove.cells = TRUE) 
  {
      if (class(x) != "PresenceAbsence") {
          stop("x argument must be a PresenceAbsence object")
      }
      if (class(names) != "character") {
          stop("names argument must be a character object")
      }
      if (class(remove.cells) != "logical") {
          stop("remove.cells argument must be a TRUE or FALSE")
      }
      pos <- colnames(x[[1]]) %in% names
      errorcont <- names %in% colnames(x[[1]])
      if (!any(errorcont)) {
          stop("None of the names provided match with PAM species")
      }
      if (any(!errorcont)) {
          warning(paste("One or more names", "provided, do not", 
              "match any of the", "PAM species"))
      }
      x[[1]] <- x[[1]][, c(1:2, which(pos)), drop = FALSE]
      if (remove.cells) {
          x[[1]] <- .removeCells(x[[1]])
      }
      rich <- rowSums(x[[1]][, -(1:2), drop = FALSE])
      x[[2]] <- rasterize(x[[1]][, c(1:2), drop = FALSE], x[[2]], 
          rich)
      x[[3]] <- colnames(x[[1]])[-c(1:2)]
      return(x)
  }
  <bytecode: 0x6f6faa0>
  <environment: namespace:letsR>
   --- function search by body ---
  Function lets.subsetPAM in namespace letsR has this body.
   ----------- END OF FAILURE REPORT -------------- 
   ----------- FAILURE REPORT -------------- 
   --- failure: the condition has length > 1 ---
   --- srcref --- 
  : 
   --- package (from environment) --- 
  letsR
   --- call from context --- 
  lets.subsetPAM(PAM[[1]], PAM[[3]][1:20])
   --- call from argument --- 
  if (class(x) != "PresenceAbsence") {
      stop("x argument must be a PresenceAbsence object")
  }
   --- R stacktrace ---
  where 1: lets.subsetPAM(PAM[[1]], PAM[[3]][1:20])
  where 2: eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
  where 3: withCallingHandlers({
      code
      NULL
  }, error = function(cnd) {
      if (can_entrace(cnd)) {
          cnd <- cnd_entrace(cnd)
      }
      return_from(env, cnd)
  })
  where 4: .capture(act$val <- eval_bare(quo_get_expr(.quo), quo_get_env(.quo)), 
      ...)
  where 5: quasi_capture(enquo(object), label, capture_error, entrace = TRUE)
  where 6 at testthat/test-lets_subsetPAM.R#41: expect_error(lets.subsetPAM(PAM[[1]], PAM[[3]][1:20]))
  where 7: eval(code, test_env)
  where 8: eval(code, test_env)
  where 9: 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 10: doTryCatch(return(expr), name, parentenv, handler)
  where 11: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 12: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 13: doTryCatch(return(expr), name, parentenv, handler)
  where 14: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 15: tryCatchList(expr, classes, parentenv, handlers)
  where 16: 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 17: test_code(desc, code, env = parent.frame())
  where 18 at testthat/test-lets_subsetPAM.R#36: test_that("lets.subsetPAM error check", {
      expect_error(lets.subsetPAM(PAM, "Bruno"))
      expect_error(lets.subsetPAM(PAM[[1]], PAM[[3]][1:20]))
      expect_error(lets.subsetPAM(PAM, 1))
      expect_error(lets.subsetPAM(PAM[[1]], PAM[[3]][1:20]))
      expect_error(lets.subsetPAM(PAM, PAM[[3]][1:20], 1))
      expect_warning(lets.subsetPAM(PAM, c("Bruno", PAM[[3]][1:20])))
  })
  where 19: eval(code, test_env)
  where 20: eval(code, test_env)
  where 21: 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 22: doTryCatch(return(expr), name, parentenv, handler)
  where 23: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 24: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 25: doTryCatch(return(expr), name, parentenv, handler)
  where 26: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 27: tryCatchList(expr, classes, parentenv, handlers)
  where 28: 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 29: test_code(NULL, exprs, env)
  where 30: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
  where 31: force(code)
  where 32: doWithOneRestart(return(expr), restart)
  where 33: withOneRestart(expr, restarts[[1L]])
  where 34: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 35: 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 36: FUN(X[[i]], ...)
  where 37: lapply(paths, test_file, env = env, reporter = current_reporter, 
      start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
  where 38: force(code)
  where 39: doWithOneRestart(return(expr), restart)
  where 40: withOneRestart(expr, restarts[[1L]])
  where 41: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 42: 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 43: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 44: 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 45: 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 46: test_check("letsR")
  
   --- value of length: 2 type: logical ---
  [1] TRUE TRUE
   --- function from context --- 
  function (x, names, remove.cells = TRUE) 
  {
      if (class(x) != "PresenceAbsence") {
          stop("x argument must be a PresenceAbsence object")
      }
      if (class(names) != "character") {
          stop("names argument must be a character object")
      }
      if (class(remove.cells) != "logical") {
          stop("remove.cells argument must be a TRUE or FALSE")
      }
      pos <- colnames(x[[1]]) %in% names
      errorcont <- names %in% colnames(x[[1]])
      if (!any(errorcont)) {
          stop("None of the names provided match with PAM species")
      }
      if (any(!errorcont)) {
          warning(paste("One or more names", "provided, do not", 
              "match any of the", "PAM species"))
      }
      x[[1]] <- x[[1]][, c(1:2, which(pos)), drop = FALSE]
      if (remove.cells) {
          x[[1]] <- .removeCells(x[[1]])
      }
      rich <- rowSums(x[[1]][, -(1:2), drop = FALSE])
      x[[2]] <- rasterize(x[[1]][, c(1:2), drop = FALSE], x[[2]], 
          rich)
      x[[3]] <- colnames(x[[1]])[-c(1:2)]
      return(x)
  }
  <bytecode: 0x6f6faa0>
  <environment: namespace:letsR>
   --- function search by body ---
  Function lets.subsetPAM in namespace letsR has this body.
   ----------- END OF FAILURE REPORT -------------- 
  
  Class: PresenceAbsence 
  Number of species: 32 
  Number of cells: 1168
  Resolution: 1, 1 (x, y)
  
  Class: PresenceAbsence
  _ _
  Number of species: 32 
  Number of cells: 1168
  Cells with presence: 1168
  Cells without presence: 0
  Species without presence: 0
  Species with the largest range: Phyllomedusa hypochondrialis
  _ _
  Grid parameters
  Resolution: 1, 1 (x, y)
  Extention: -93, -29, -57, 15 (xmin, xmax, ymin, ymax)
  Coord. Ref.:  +proj=longlat +datum=WGS84== testthat results  ===========================================================
  [ OK: 138 | SKIPPED: 15 | WARNINGS: 11 | FAILED: 41 ]
  1. Failure: Other parameters work (@test-TimLucas.r#76) 
  2. Failure: lets.addpoly works fine, onlyvar = FALSE (@test-lets_addpoly.R#11) 
  3. Failure: lets.addpoly works fine, onlyvar = TRUE (@test-lets_addpoly.R#18) 
  4. Failure: lets.addvar works fine (@test-lets_addvar.R#11) 
  5. Failure: lets.addvar works fine, different fun (@test-lets_addvar.R#20) 
  6. Failure: lets.addvar works fine, onlyvar = TRUE (@test-lets_addvar.R#29) 
  7. Failure: lets.addvar works fine, multiple rasters (@test-lets_addvar.R#38) 
  8. Failure: lets.addpoly lets.classvar fine (@test-lets_classvar.R#13) 
  9. Failure: lets.addpoly lets.classvar fine, xy = FALSE (@test-lets_classvar.R#24) 
  1. ...
  
  Error: testthat unit tests failed
  Execution halted