Running 'testthat.R' [108s/115s]
Running the tests in 'tests/testthat.R' failed.
Complete output:
  > library(testthat)
  > library(INDperform)
  > 
  > test_check("INDperform")
    variable required_data_type
  1      edf            numeric
  # A tibble: 2 x 5
       id ind   press nr_test_timesteps NAs_in_ind_press
    <int> <chr> <chr>             <int>            <int>
  1     1 TZA   Tsum                  3                3
  2     3 MS    Tsum                  3                3
    variable required_data_type
  1        a               list
  2        b             factor
  3        c          character
  [1] 1 1 1 1 1 1 1 2
  [1] 2 2 4 2 2 2 2 2
  # A tibble: 12 x 5
        id ind     press nr_test_timesteps NAs_in_ind_press
     <int> <chr>   <chr>             <int>            <int>
   1     1 TZA     Tsum                  3                3
   2     3 MS      Tsum                  3                3
   3     5 rCC     Tsum                  3                3
   4     7 Cops    Tsum                  3                3
   5     9 Micro   Tsum                  3                3
   6    11 rZPPP   Tsum                  3                3
   7    13 Sprat   Tsum                  3                3
   8    15 Herring Tsum                  3                3
   9    17 Stickle Tsum                  3                3
  10    19 Cod     Tsum                  3                3
  11    21 SPF     Tsum                  3                3
  12    23 LPF     Tsum                  3                3
  # A tibble: 1 x 5
       id ind      press nr_test_timesteps NAs_in_ind_press
    <int> <chr>    <chr>             <int>            <int>
  1     3 test_ind press                 3                3
    variable required_data_type
  1       id            integer
  # A tibble: 1 x 4
       id ind      press error_message                                            
    <int> <chr>    <chr> <chr>                                                    
  1     3 test_ind press "Error in mgcv::gam(stats::as.formula(paste0(names(dat)[~
  # A tibble: 1 x 6
       id ind   press model_type corrstruc error_message                          
    <int> <chr> <chr> <chr>      <chr>     <chr>                                  
  1    44 Sprat Swin  gamm       arma21    "Error in lme.formula(y ~ X - 1, rando~
  # A tibble: 1 x 6
       id ind   press model_type corrstruc error_message                          
    <int> <chr> <chr> <chr>      <chr>     <chr>                                  
  1    39 rZPPP Nwin  gamm       arma12    "Error in lme.formula(y ~ X - 1, rando~
  # A tibble: 1 x 6
       id ind   press model_type corrstruc error_message                          
    <int> <chr> <chr> <chr>      <chr>     <chr>                                  
  1    39 rZPPP Nwin  gamm       arma12    "Error in lme.formula(y ~ X - 1, rando~
  
   Maximum number of PQL iterations:  20 
  
   Maximum number of PQL iterations:  20 
  
   Maximum number of PQL iterations:  20 
  
   Maximum number of PQL iterations:  20 
  
   Maximum number of PQL iterations:  20 
  
   Maximum number of PQL iterations:  20 
  # A tibble: 4 x 6
       id ind   press model_type corrstruc error_message                          
    <int> <chr> <chr> <chr>      <chr>     <chr>                                  
  1     1 TZA   Tsum  gamm       ar2       "Error in `coef<-.corARMA`(`*tmp*`, va~
  2     1 TZA   Tsum  gamm       arma11    "Error in `coef<-.corARMA`(`*tmp*`, va~
  3     1 TZA   Tsum  gamm       arma12    "Error in `coef<-.corARMA`(`*tmp*`, va~
  4     1 TZA   Tsum  gamm       arma21    "Error in `coef<-.corARMA`(`*tmp*`, va~
  
   Maximum number of PQL iterations:  20 
  
   Maximum number of PQL iterations:  20 
  
   Maximum number of PQL iterations:  20 
  
   Maximum number of PQL iterations:  20 
  
   Maximum number of PQL iterations:  20 
  
   Maximum number of PQL iterations:  20 
  # A tibble: 2 x 6
       id ind   press model_type corrstruc error_message                          
    <int> <chr> <chr> <chr>      <chr>     <chr>                                  
  1     1 TZA   Tsum  gamm       arma11    "Error in lme.formula(fixed = fixed, r~
  2     1 TZA   Tsum  gamm       arma21    "Error in lme.formula(fixed = fixed, r~
  
   Maximum number of PQL iterations:  20 
  
   Maximum number of PQL iterations:  20 
  
   Maximum number of PQL iterations:  20 
  
   Maximum number of PQL iterations:  20 
  
   Maximum number of PQL iterations:  20 
  
   Maximum number of PQL iterations:  20 
  # A tibble: 3 x 6
       id ind   press model_type corrstruc error_message                          
    <int> <chr> <chr> <chr>      <chr>     <chr>                                  
  1     1 TZA   Tsum  gamm       arma11    "Error in lme.formula(fixed = fixed, r~
  2     1 TZA   Tsum  gamm       arma12    "Error in lme.formula(fixed = fixed, r~
  3     1 TZA   Tsum  gamm       arma21    "Error in lme.formula(fixed = fixed, r~
  # A tibble: 1 x 5
       id ind   press nr_test_timesteps NAs_in_ind_press
    <int> <chr> <chr>             <int>            <int>
  1     2 test  press                 3                3
    variable required_data_type
  1       id            integer
  
   Maximum number of PQL iterations:  20 
  
   Maximum number of PQL iterations:  20 
  
   Maximum number of PQL iterations:  20 
  
   Maximum number of PQL iterations:  20 
  
   Maximum number of PQL iterations:  20 
  
   Maximum number of PQL iterations:  20 
  
   Maximum number of PQL iterations:  20 
  
   Maximum number of PQL iterations:  20 
  
   Maximum number of PQL iterations:  20 
  
   Maximum number of PQL iterations:  20 
  
   Maximum number of PQL iterations:  20 
  
   Maximum number of PQL iterations:  20 
  
   Maximum number of PQL iterations:  20 
  
   Maximum number of PQL iterations:  20 
  
   Maximum number of PQL iterations:  20 
  
   Maximum number of PQL iterations:  20 
  
   Maximum number of PQL iterations:  20 
  
   Maximum number of PQL iterations:  20 
  
   Maximum number of PQL iterations:  20 
  
   Maximum number of PQL iterations:  20 
  
   Maximum number of PQL iterations:  20 
  
   Maximum number of PQL iterations:  20 
  
   Maximum number of PQL iterations:  20 
  
   Maximum number of PQL iterations:  20 
  
   Maximum number of PQL iterations:  20 
  
   Maximum number of PQL iterations:  20 
  
   Maximum number of PQL iterations:  20 
  
   Maximum number of PQL iterations:  20 
  
   Maximum number of PQL iterations:  20 
  
   Maximum number of PQL iterations:  20 
  # A tibble: 6 x 6
       id ind   press model_type corrstruc error_message                          
    <int> <chr> <chr> <chr>      <chr>     <chr>                                  
  1     2 test  press gamm       none      "Error in mgcv::gamm(formula = form, d~
  2     2 test  press gamm       ar1       "Error in mgcv::gamm(formula = form, d~
  3     2 test  press gamm       ar2       "Error in mgcv::gamm(formula = form, d~
  4     2 test  press gamm       arma11    "Error in mgcv::gamm(formula = form, d~
  5     2 test  press gamm       arma12    "Error in mgcv::gamm(formula = form, d~
  6     2 test  press gamm       arma21    "Error in mgcv::gamm(formula = form, d~
  # A tibble: 1 x 3
    ind_id ind    error_message                                                   
     <int> <chr>  <chr>                                                           
  1      5 ind_na "Error in mgcv::gam(stats::as.formula(paste0(ind_name, \" ~ 1 +~
   ----------- FAILURE REPORT -------------- 
   --- failure: the condition has length > 1 ---
   --- srcref --- 
  : 
   --- package (from environment) --- 
  INDperform
   --- call from context --- 
  plot_clust_sc(x = rbind(1:10, 1:10))
   --- call from argument --- 
  if (!class(x) %in% c("hclust", "dendrogram", "tree", "rpart", 
      "agnes", "diana", "twins")) {
      stop("x is not an object that contains dendrogram information (should be of class hclust, dendrogram. tree, rpwart, agnes, diana, twins). Use the output of clust_sc() function here!")
  }
   --- R stacktrace ---
  where 1: plot_clust_sc(x = rbind(1:10, 1:10))
  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_plot_clust_sc.R#7: expect_error(plot_clust_sc(x = rbind(1:10, 1:10)), "x is not an object that contains")
  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_plot_clust_sc.R#4: test_that("test error messages", {
      expect_error(plot_clust_sc(), "Argument x is missing")
      expect_error(plot_clust_sc(x = 1:10), "x is not an object that contains")
      expect_error(plot_clust_sc(x = rbind(1:10, 1:10)), "x is not an object that contains")
      expect_error(plot_clust_sc(x = data.frame(1:10, 1:10)), "x is not an object that contains")
      expect_error(plot_clust_sc(x = list(1:10)), "x is not an object that contains")
  })
  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("INDperform")
  
   --- value of length: 2 type: logical ---
  [1] TRUE TRUE
   --- function from context --- 
  function (x, rotate = FALSE, text_size = 15) 
  {
      if (missing(x)) {
          stop("Argument x is missing.")
      }
      if (!class(x) %in% c("hclust", "dendrogram", "tree", "rpart", 
          "agnes", "diana", "twins")) {
          stop("x is not an object that contains dendrogram information (should be of class hclust, dendrogram. tree, rpwart, agnes, diana, twins). Use the output of clust_sc() function here!")
      }
      dataClass <- if (inherits(x, "dendro")) {
          x$class
      }
      else {
          class(x)
      }
      angle <- if (dataClass %in% c("dendrogram", "hclust")) {
          ifelse(rotate, 0, 90)
      }
      else {
          ifelse(rotate, 90, 0)
      }
      hjust <- if (dataClass %in% c("dendrogram", "hclust")) {
          ifelse(rotate, 0, 1)
      }
      else {
          0.5
      }
      if (!ggdendro::is.dendro(x)) 
          data <- ggdendro::dendro_data(x)
      p <- ggplot2::ggplot() + ggplot2::geom_blank()
      p <- p + ggplot2::geom_segment(data = ggdendro::segment(data), 
          ggplot2::aes(x = !!rlang::sym("x"), y = !!rlang::sym("y"), 
              xend = !!rlang::sym("xend"), yend = !!rlang::sym("yend"))) + 
          ggplot2::scale_x_continuous(breaks = seq_along(data$labels$label), 
              labels = data$labels$label)
      if (rotate) {
          p <- p + ggplot2::coord_flip()
          p <- p + ggplot2::scale_y_continuous()
      }
      else {
          p <- p + ggplot2::scale_y_continuous()
      }
      p <- p + ggplot2::labs(title = "Similarities in performance across indicators")
      p <- p + ggplot2::theme(title = ggplot2::element_text(size = text_size), 
          axis.text.x = ggplot2::element_text(angle = angle, hjust = 1, 
              size = text_size), axis.text.y = ggplot2::element_text(angle = 0, 
              hjust = 1, size = text_size), axis.title.x = ggplot2::element_blank(), 
          axis.title.y = ggplot2::element_blank(), axis.ticks = ggplot2::element_blank(), 
          axis.line = ggplot2::element_blank(), panel.background = ggplot2::element_blank(), 
          panel.grid.major = ggplot2::element_blank(), panel.grid.minor = ggplot2::element_blank(), 
          panel.border = ggplot2::element_blank())
      return(p)
  }
  <bytecode: 0x32d4038>
  <environment: namespace:INDperform>
   --- function search by body ---
  Function plot_clust_sc in namespace INDperform has this body.
   ----------- END OF FAILURE REPORT -------------- 
  -- 1. Failure: test error messages (@test_plot_clust_sc.R#7)  ------------------
  `plot_clust_sc(x = rbind(1:10, 1:10))` threw an error with unexpected message.
  Expected match: "x is not an object that contains"
  Actual message: "the condition has length > 1"
  Backtrace:
   1. testthat::expect_error(...)
   6. INDperform::plot_clust_sc(x = rbind(1:10, 1:10))
  
    variable required_data_type
  1      edf            numeric
    variable required_data_type
  1     pred               list
     press press_type
  1   Tsum   add here
  2   Swin   add here
  3   Pwin   add here
  4   Nwin   add here
  5 Fsprat   add here
  6   Fher   add here
  7   Fcod   add here
    variable required_data_type
  1      edf            numeric
  The conditions set in the crit_scores table for sub-criterion
  C9_1
  are not unique, i.e. conditions are met multiple times!
  Please correct your crit_score table before you continue.  variable required_data_type
  1      edf            numeric
    variable required_data_type
  1     r_sq            numeric
  == testthat results  ===========================================================
  [ OK: 616 | SKIPPED: 0 | WARNINGS: 35 | FAILED: 1 ]
  1. Failure: test error messages (@test_plot_clust_sc.R#7) 
  
  Error: testthat unit tests failed
  Execution halted