Running ‘testthat.R’ [32s/34s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(cutpointr)
  > 
  > test_check("cutpointr")
  ── 1. Error: Cutpointr returns a cutpointr without NAs and a certain Nr of rows 
  VECTOR_ELT() can only be applied to a 'list', not a 'double'
  1: expect_silent(plot(opt_cut)) at testthat/test-cutpointr.R:7
  2: quasi_capture(enquo(object), evaluate_promise)
  3: capture(act$val <- eval_bare(get_expr(quo), get_env(quo)))
  4: withr::with_output_sink(temp, withCallingHandlers(withVisible(code), warning = handle_warning, 
         message = handle_message))
  5: force(code)
  6: withCallingHandlers(withVisible(code), warning = handle_warning, message = handle_message)
  7: withVisible(code)
  8: eval_bare(get_expr(quo), get_env(quo))
  9: plot(opt_cut)
  10: plot.cutpointr(opt_cut)
  ...
  15: ggplot_gtable(ggplot_build(x))
  16: ggplot_gtable.ggplot_built(ggplot_build(x))
  17: layout$render(geom_grobs, data, theme, plot$labels)
  18: f(..., self = self)
  19: self$facet$draw_panels(panels, self$layout, self$panel_scales_x, self$panel_scales_y, 
         self$panel_params, self$coord, data, theme, self$facet_params)
  20: f(...)
  21: render_strips(structure(labels_df, type = "rows"), structure(labels_df, type = "cols"), 
         params$labeller, theme)
  22: build_strip(x, labeller, theme, TRUE)
  23: ggstrip(grobs, theme, element, gp, horizontal, clip = "on")
  24: Summary.unit(structure(c(4.4, 4.4), unit = 8L, class = c("margin", "unit")), na.rm = FALSE)
  
  ── 2. Error: Cutpointr works with different data types (@test-cutpointr.R#22)  ─
  VECTOR_ELT() can only be applied to a 'list', not a 'double'
  1: expect_silent(plot(opt_cut)) at testthat/test-cutpointr.R:22
  2: quasi_capture(enquo(object), evaluate_promise)
  3: capture(act$val <- eval_bare(get_expr(quo), get_env(quo)))
  4: withr::with_output_sink(temp, withCallingHandlers(withVisible(code), warning = handle_warning, 
         message = handle_message))
  5: force(code)
  6: withCallingHandlers(withVisible(code), warning = handle_warning, message = handle_message)
  7: withVisible(code)
  8: eval_bare(get_expr(quo), get_env(quo))
  9: plot(opt_cut)
  10: plot.cutpointr(opt_cut)
  ...
  15: ggplot_gtable(ggplot_build(x))
  16: ggplot_gtable.ggplot_built(ggplot_build(x))
  17: layout$render(geom_grobs, data, theme, plot$labels)
  18: f(..., self = self)
  19: self$facet$draw_panels(panels, self$layout, self$panel_scales_x, self$panel_scales_y, 
         self$panel_params, self$coord, data, theme, self$facet_params)
  20: f(...)
  21: render_strips(structure(labels_df, type = "rows"), structure(labels_df, type = "cols"), 
         params$labeller, theme)
  22: build_strip(x, labeller, theme, TRUE)
  23: ggstrip(grobs, theme, element, gp, horizontal, clip = "on")
  24: Summary.unit(structure(c(4.4, 4.4), unit = 8L, class = c("margin", "unit")), na.rm = FALSE)
  
  ── 3. Error: Plotting with bootstrapping is silent (@test-cutpointr.R#95)  ─────
  VECTOR_ELT() can only be applied to a 'list', not a 'double'
  1: expect_silent(plot(opt_cut)) at testthat/test-cutpointr.R:95
  2: quasi_capture(enquo(object), evaluate_promise)
  3: capture(act$val <- eval_bare(get_expr(quo), get_env(quo)))
  4: withr::with_output_sink(temp, withCallingHandlers(withVisible(code), warning = handle_warning, 
         message = handle_message))
  5: force(code)
  6: withCallingHandlers(withVisible(code), warning = handle_warning, message = handle_message)
  7: withVisible(code)
  8: eval_bare(get_expr(quo), get_env(quo))
  9: plot(opt_cut)
  10: plot.cutpointr(opt_cut)
  ...
  15: ggplot_gtable(ggplot_build(x))
  16: ggplot_gtable.ggplot_built(ggplot_build(x))
  17: layout$render(geom_grobs, data, theme, plot$labels)
  18: f(..., self = self)
  19: self$facet$draw_panels(panels, self$layout, self$panel_scales_x, self$panel_scales_y, 
         self$panel_params, self$coord, data, theme, self$facet_params)
  20: f(...)
  21: render_strips(structure(labels_df, type = "rows"), structure(labels_df, type = "cols"), 
         params$labeller, theme)
  22: build_strip(x, labeller, theme, TRUE)
  23: ggstrip(grobs, theme, element, gp, horizontal, clip = "on")
  24: Summary.unit(structure(c(4.4, 4.4), unit = 8L, class = c("margin", "unit")), na.rm = FALSE)
  
  ── 4. Error: Correct midpoints are found (@test-cutpointr.R#127)  ──────────────
  VECTOR_ELT() can only be applied to a 'list', not a 'double'
  1: expect_warning(plot(optcut)) at testthat/test-cutpointr.R:127
  2: quasi_capture(enquo(object), capture_warnings, label = label)
  3: capture(act$val <- eval_bare(get_expr(quo), get_env(quo)))
  4: withCallingHandlers(code, warning = function(condition) {
         out$push(condition)
         invokeRestart("muffleWarning")
     })
  5: eval_bare(get_expr(quo), get_env(quo))
  6: plot(optcut)
  7: plot.cutpointr(optcut)
  8: suppressMessages(p <- grid_arrange_shared_legend(plots, nrow = rows, ncol = 2, position = pos))
  9: withCallingHandlers(expr, message = function(c) invokeRestart("muffleMessage"))
  10: grid_arrange_shared_legend(plots, nrow = rows, ncol = 2, position = pos)
  11: ggplot2::ggplotGrob(plots[[1]] + ggplot2::theme(legend.position = position))
  12: ggplot_gtable(ggplot_build(x))
  13: ggplot_gtable.ggplot_built(ggplot_build(x))
  14: layout$render(geom_grobs, data, theme, plot$labels)
  15: f(..., self = self)
  16: self$facet$draw_panels(panels, self$layout, self$panel_scales_x, self$panel_scales_y, 
         self$panel_params, self$coord, data, theme, self$facet_params)
  17: f(...)
  18: render_strips(structure(labels_df, type = "rows"), structure(labels_df, type = "cols"), 
         params$labeller, theme)
  19: build_strip(x, labeller, theme, TRUE)
  20: ggstrip(grobs, theme, element, gp, horizontal, clip = "on")
  21: Summary.unit(structure(c(4.4, 4.4), unit = 8L, class = c("margin", "unit")), na.rm = FALSE)
  
  ── 5. Error: no duplicate column names are returned (@test-cutpointr.R#152)  ───
  VECTOR_ELT() can only be applied to a 'list', not a 'double'
  1: expect_silent(plot(optcut)) at testthat/test-cutpointr.R:152
  2: quasi_capture(enquo(object), evaluate_promise)
  3: capture(act$val <- eval_bare(get_expr(quo), get_env(quo)))
  4: withr::with_output_sink(temp, withCallingHandlers(withVisible(code), warning = handle_warning, 
         message = handle_message))
  5: force(code)
  6: withCallingHandlers(withVisible(code), warning = handle_warning, message = handle_message)
  7: withVisible(code)
  8: eval_bare(get_expr(quo), get_env(quo))
  9: plot(optcut)
  10: plot.cutpointr(optcut)
  ...
  15: ggplot_gtable(ggplot_build(x))
  16: ggplot_gtable.ggplot_built(ggplot_build(x))
  17: layout$render(geom_grobs, data, theme, plot$labels)
  18: f(..., self = self)
  19: self$facet$draw_panels(panels, self$layout, self$panel_scales_x, self$panel_scales_y, 
         self$panel_params, self$coord, data, theme, self$facet_params)
  20: f(...)
  21: render_strips(structure(labels_df, type = "rows"), structure(labels_df, type = "cols"), 
         params$labeller, theme)
  22: build_strip(x, labeller, theme, TRUE)
  23: ggstrip(grobs, theme, element, gp, horizontal, clip = "on")
  24: Summary.unit(structure(c(4.4, 4.4), unit = 8L, class = c("margin", "unit")), na.rm = FALSE)
  
  ── 6. Error: Correct cutpoints with example data (@test-cutpointr.R#206)  ──────
  VECTOR_ELT() can only be applied to a 'list', not a 'double'
  1: expect_silent(plot(optcut)) at testthat/test-cutpointr.R:206
  2: quasi_capture(enquo(object), evaluate_promise)
  3: capture(act$val <- eval_bare(get_expr(quo), get_env(quo)))
  4: withr::with_output_sink(temp, withCallingHandlers(withVisible(code), warning = handle_warning, 
         message = handle_message))
  5: force(code)
  6: withCallingHandlers(withVisible(code), warning = handle_warning, message = handle_message)
  7: withVisible(code)
  8: eval_bare(get_expr(quo), get_env(quo))
  9: plot(optcut)
  10: plot.cutpointr(optcut)
  ...
  15: ggplot_gtable(ggplot_build(x))
  16: ggplot_gtable.ggplot_built(ggplot_build(x))
  17: layout$render(geom_grobs, data, theme, plot$labels)
  18: f(..., self = self)
  19: self$facet$draw_panels(panels, self$layout, self$panel_scales_x, self$panel_scales_y, 
         self$panel_params, self$coord, data, theme, self$facet_params)
  20: f(...)
  21: render_strips(structure(labels_df, type = "rows"), structure(labels_df, type = "cols"), 
         params$labeller, theme)
  22: build_strip(x, labeller, theme, TRUE)
  23: ggstrip(grobs, theme, element, gp, horizontal, clip = "on")
  24: Summary.unit(structure(c(4.4, 4.4), unit = 8L, class = c("margin", "unit")), na.rm = FALSE)
  
  ── 7. Error: Metric colnames that are already in cutpointr are modified (@test-c
  VECTOR_ELT() can only be applied to a 'list', not a 'double'
  1: expect_silent(plot(opt_cut)) at testthat/test-cutpointr.R:239
  2: quasi_capture(enquo(object), evaluate_promise)
  3: capture(act$val <- eval_bare(get_expr(quo), get_env(quo)))
  4: withr::with_output_sink(temp, withCallingHandlers(withVisible(code), warning = handle_warning, 
         message = handle_message))
  5: force(code)
  6: withCallingHandlers(withVisible(code), warning = handle_warning, message = handle_message)
  7: withVisible(code)
  8: eval_bare(get_expr(quo), get_env(quo))
  9: plot(opt_cut)
  10: plot.cutpointr(opt_cut)
  ...
  15: ggplot_gtable(ggplot_build(x))
  16: ggplot_gtable.ggplot_built(ggplot_build(x))
  17: layout$render(geom_grobs, data, theme, plot$labels)
  18: f(..., self = self)
  19: self$facet$draw_panels(panels, self$layout, self$panel_scales_x, self$panel_scales_y, 
         self$panel_params, self$coord, data, theme, self$facet_params)
  20: f(...)
  21: render_strips(structure(labels_df, type = "rows"), structure(labels_df, type = "cols"), 
         params$labeller, theme)
  22: build_strip(x, labeller, theme, TRUE)
  23: ggstrip(grobs, theme, element, gp, horizontal, clip = "on")
  24: Summary.unit(structure(c(4.4, 4.4), unit = 8L, class = c("margin", "unit")), na.rm = FALSE)
  
  ── 8. Error: smoothing splines lead to plausible results (@test-cutpointr.R#889)
  VECTOR_ELT() can only be applied to a 'list', not a 'double'
  1: expect_silent(plot(cp)) at testthat/test-cutpointr.R:889
  2: quasi_capture(enquo(object), evaluate_promise)
  3: capture(act$val <- eval_bare(get_expr(quo), get_env(quo)))
  4: withr::with_output_sink(temp, withCallingHandlers(withVisible(code), warning = handle_warning, 
         message = handle_message))
  5: force(code)
  6: withCallingHandlers(withVisible(code), warning = handle_warning, message = handle_message)
  7: withVisible(code)
  8: eval_bare(get_expr(quo), get_env(quo))
  9: plot(cp)
  10: plot.cutpointr(cp)
  ...
  15: ggplot_gtable(ggplot_build(x))
  16: ggplot_gtable.ggplot_built(ggplot_build(x))
  17: layout$render(geom_grobs, data, theme, plot$labels)
  18: f(..., self = self)
  19: self$facet$draw_panels(panels, self$layout, self$panel_scales_x, self$panel_scales_y, 
         self$panel_params, self$coord, data, theme, self$facet_params)
  20: f(...)
  21: render_strips(structure(labels_df, type = "rows"), structure(labels_df, type = "cols"), 
         params$labeller, theme)
  22: build_strip(x, labeller, theme, TRUE)
  23: ggstrip(grobs, theme, element, gp, horizontal, clip = "on")
  24: Summary.unit(structure(c(4.4, 4.4), unit = 8L, class = c("margin", "unit")), na.rm = FALSE)
  
  ── 9. Error: gam smoothing leads to plausible results (@test-cutpointr.R#915)  ─
  VECTOR_ELT() can only be applied to a 'list', not a 'double'
  1: expect_silent(plot(cp)) at testthat/test-cutpointr.R:915
  2: quasi_capture(enquo(object), evaluate_promise)
  3: capture(act$val <- eval_bare(get_expr(quo), get_env(quo)))
  4: withr::with_output_sink(temp, withCallingHandlers(withVisible(code), warning = handle_warning, 
         message = handle_message))
  5: force(code)
  6: withCallingHandlers(withVisible(code), warning = handle_warning, message = handle_message)
  7: withVisible(code)
  8: eval_bare(get_expr(quo), get_env(quo))
  9: plot(cp)
  10: plot.cutpointr(cp)
  ...
  15: ggplot_gtable(ggplot_build(x))
  16: ggplot_gtable.ggplot_built(ggplot_build(x))
  17: layout$render(geom_grobs, data, theme, plot$labels)
  18: f(..., self = self)
  19: self$facet$draw_panels(panels, self$layout, self$panel_scales_x, self$panel_scales_y, 
         self$panel_params, self$coord, data, theme, self$facet_params)
  20: f(...)
  21: render_strips(structure(labels_df, type = "rows"), structure(labels_df, type = "cols"), 
         params$labeller, theme)
  22: build_strip(x, labeller, theme, TRUE)
  23: ggstrip(grobs, theme, element, gp, horizontal, clip = "on")
  24: Summary.unit(structure(c(4.4, 4.4), unit = 8L, class = c("margin", "unit")), na.rm = FALSE)
  
  ── 10. Error: bootstrapped cutpoints lead to plausible results (@test-cutpointr.
  VECTOR_ELT() can only be applied to a 'list', not a 'double'
  1: expect_silent(plot(cp)) at testthat/test-cutpointr.R:942
  2: quasi_capture(enquo(object), evaluate_promise)
  3: capture(act$val <- eval_bare(get_expr(quo), get_env(quo)))
  4: withr::with_output_sink(temp, withCallingHandlers(withVisible(code), warning = handle_warning, 
         message = handle_message))
  5: force(code)
  6: withCallingHandlers(withVisible(code), warning = handle_warning, message = handle_message)
  7: withVisible(code)
  8: eval_bare(get_expr(quo), get_env(quo))
  9: plot(cp)
  10: plot.cutpointr(cp)
  ...
  15: ggplot_gtable(ggplot_build(x))
  16: ggplot_gtable.ggplot_built(ggplot_build(x))
  17: layout$render(geom_grobs, data, theme, plot$labels)
  18: f(..., self = self)
  19: self$facet$draw_panels(panels, self$layout, self$panel_scales_x, self$panel_scales_y, 
         self$panel_params, self$coord, data, theme, self$facet_params)
  20: f(...)
  21: render_strips(structure(labels_df, type = "rows"), structure(labels_df, type = "cols"), 
         params$labeller, theme)
  22: build_strip(x, labeller, theme, TRUE)
  23: ggstrip(grobs, theme, element, gp, horizontal, clip = "on")
  24: Summary.unit(structure(c(4.4, 4.4), unit = 8L, class = c("margin", "unit")), na.rm = FALSE)
  
  ── 11. Error: cutpointr works with custom method function (@test-cutpointr.R#112
  VECTOR_ELT() can only be applied to a 'list', not a 'double'
  1: expect_silent(plot(cp)) at testthat/test-cutpointr.R:1129
  2: quasi_capture(enquo(object), evaluate_promise)
  3: capture(act$val <- eval_bare(get_expr(quo), get_env(quo)))
  4: withr::with_output_sink(temp, withCallingHandlers(withVisible(code), warning = handle_warning, 
         message = handle_message))
  5: force(code)
  6: withCallingHandlers(withVisible(code), warning = handle_warning, message = handle_message)
  7: withVisible(code)
  8: eval_bare(get_expr(quo), get_env(quo))
  9: plot(cp)
  10: plot.cutpointr(cp)
  ...
  15: ggplot_gtable(ggplot_build(x))
  16: ggplot_gtable.ggplot_built(ggplot_build(x))
  17: layout$render(geom_grobs, data, theme, plot$labels)
  18: f(..., self = self)
  19: self$facet$draw_panels(panels, self$layout, self$panel_scales_x, self$panel_scales_y, 
         self$panel_params, self$coord, data, theme, self$facet_params)
  20: f(...)
  21: render_strips(structure(labels_df, type = "rows"), structure(labels_df, type = "cols"), 
         params$labeller, theme)
  22: build_strip(x, labeller, theme, TRUE)
  23: ggstrip(grobs, theme, element, gp, horizontal, clip = "on")
  24: Summary.unit(structure(c(4.4, 4.4), unit = 8L, class = c("margin", "unit")), na.rm = FALSE)
  
  ══ testthat results  ═══════════════════════════════════════════════════════════
  OK: 250 SKIPPED: 0 FAILED: 11
  1. Error: Cutpointr returns a cutpointr without NAs and a certain Nr of rows (@test-cutpointr.R#7) 
  2. Error: Cutpointr works with different data types (@test-cutpointr.R#22) 
  3. Error: Plotting with bootstrapping is silent (@test-cutpointr.R#95) 
  4. Error: Correct midpoints are found (@test-cutpointr.R#127) 
  5. Error: no duplicate column names are returned (@test-cutpointr.R#152) 
  6. Error: Correct cutpoints with example data (@test-cutpointr.R#206) 
  7. Error: Metric colnames that are already in cutpointr are modified (@test-cutpointr.R#239) 
  8. Error: smoothing splines lead to plausible results (@test-cutpointr.R#889) 
  9. Error: gam smoothing leads to plausible results (@test-cutpointr.R#915) 
  1. ...
  
  Error: testthat unit tests failed
  Execution halted