Running ‘testthat.R’ [14s/21s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(stabm)
  > 
  > test_check("stabm")
  ── 1. Error: numeric features (@test_plot_features.R#13)  ──────────────────────
  VECTOR_ELT() can only be applied to a 'list', not a 'double'
  1: checkmate::expect_class(plotFeatures(list(c(2, 3, 5, 6, 7), 1:5, 2:7)), classes = c("gg", 
         "ggplot"), null.ok = FALSE) at testthat/test_plot_features.R:13
  2: checkClass(x, classes, ordered, null.ok)
  3: plotFeatures(list(c(2, 3, 5, 6, 7), 1:5, 2:7))
  4: cowplot::insert_yaxis_grob(final.plot, dendro.repls, grid::unit(0.2, "null"), position = "right")
  5: plot_to_gtable(plot)
  6: ggplot2::ggplotGrob(plot)
  7: ggplot_gtable(ggplot_build(x))
  8: ggplot_gtable.ggplot_built(ggplot_build(x))
  9: build_guides(plot$scales, plot$layers, plot$mapping, position, theme, plot$guides, 
         plot$labels)
  10: guides_gengrob(gdefs, theme)
  ...
  20: pushvpgp(x)
  21: pushgrobvp(x$vp)
  22: pushgrobvp.viewport(x$vp)
  23: pushViewport(vp, recording = FALSE)
  24: lapply(vps, push.vp, recording)
  25: FUN(X[[i]], ...)
  26: push.vp.vpTree(X[[i]], ...)
  27: push.vp(vp$parent, recording)
  28: push.vp.viewport(vp$parent, recording)
  29: grid.Call.graphics(C_setviewport, vp, TRUE)
  
  ── 2. Error: character features (@test_plot_features.R#18)  ────────────────────
  VECTOR_ELT() can only be applied to a 'list', not a 'double'
  1: checkmate::expect_class(plotFeatures(list(paste0("V", c(2, 3, 5, 6, 7)), paste0("V", 
         1:5), paste0("V", 2:7))), classes = c("gg", "ggplot"), null.ok = FALSE) at testthat/test_plot_features.R:18
  2: checkClass(x, classes, ordered, null.ok)
  3: plotFeatures(list(paste0("V", c(2, 3, 5, 6, 7)), paste0("V", 1:5), paste0("V", 2:7)))
  4: cowplot::insert_yaxis_grob(final.plot, dendro.repls, grid::unit(0.2, "null"), position = "right")
  5: plot_to_gtable(plot)
  6: ggplot2::ggplotGrob(plot)
  7: ggplot_gtable(ggplot_build(x))
  8: ggplot_gtable.ggplot_built(ggplot_build(x))
  9: build_guides(plot$scales, plot$layers, plot$mapping, position, theme, plot$guides, 
         plot$labels)
  10: guides_gengrob(gdefs, theme)
  ...
  20: pushvpgp(x)
  21: pushgrobvp(x$vp)
  22: pushgrobvp.viewport(x$vp)
  23: pushViewport(vp, recording = FALSE)
  24: lapply(vps, push.vp, recording)
  25: FUN(X[[i]], ...)
  26: push.vp.vpTree(X[[i]], ...)
  27: push.vp(vp$parent, recording)
  28: push.vp.viewport(vp$parent, recording)
  29: grid.Call.graphics(C_setviewport, vp, TRUE)
  
  ── 3. Error: one of three empty (@test_plot_features.R#24)  ────────────────────
  VECTOR_ELT() can only be applied to a 'list', not a 'double'
  1: checkmate::expect_class(plotFeatures(list(paste0("V", c(2, 3, 5, 6, 7)), paste0("V", 
         1:5), character(0L))), classes = c("gg", "ggplot"), null.ok = FALSE) at testthat/test_plot_features.R:24
  2: checkClass(x, classes, ordered, null.ok)
  3: plotFeatures(list(paste0("V", c(2, 3, 5, 6, 7)), paste0("V", 1:5), character(0L)))
  4: cowplot::insert_yaxis_grob(final.plot, dendro.repls, grid::unit(0.2, "null"), position = "right")
  5: plot_to_gtable(plot)
  6: ggplot2::ggplotGrob(plot)
  7: ggplot_gtable(ggplot_build(x))
  8: ggplot_gtable.ggplot_built(ggplot_build(x))
  9: build_guides(plot$scales, plot$layers, plot$mapping, position, theme, plot$guides, 
         plot$labels)
  10: guides_gengrob(gdefs, theme)
  ...
  20: pushvpgp(x)
  21: pushgrobvp(x$vp)
  22: pushgrobvp.viewport(x$vp)
  23: pushViewport(vp, recording = FALSE)
  24: lapply(vps, push.vp, recording)
  25: FUN(X[[i]], ...)
  26: push.vp.vpTree(X[[i]], ...)
  27: push.vp(vp$parent, recording)
  28: push.vp.viewport(vp$parent, recording)
  29: grid.Call.graphics(C_setviewport, vp, TRUE)
  
  ── 4. Error: one of two empty (@test_plot_features.R#30)  ──────────────────────
  VECTOR_ELT() can only be applied to a 'list', not a 'double'
  1: checkmate::expect_class(plotFeatures(list(3, integer(0L))), classes = c("gg", "ggplot"), 
         null.ok = FALSE) at testthat/test_plot_features.R:30
  2: checkClass(x, classes, ordered, null.ok)
  3: plotFeatures(list(3, integer(0L)))
  4: cowplot::insert_yaxis_grob(final.plot, dendro.repls, grid::unit(0.2, "null"), position = "right")
  5: plot_to_gtable(plot)
  6: ggplot2::ggplotGrob(plot)
  7: ggplot_gtable(ggplot_build(x))
  8: ggplot_gtable.ggplot_built(ggplot_build(x))
  9: build_guides(plot$scales, plot$layers, plot$mapping, position, theme, plot$guides, 
         plot$labels)
  10: guides_gengrob(gdefs, theme)
  ...
  20: pushvpgp(x)
  21: pushgrobvp(x$vp)
  22: pushgrobvp.viewport(x$vp)
  23: pushViewport(vp, recording = FALSE)
  24: lapply(vps, push.vp, recording)
  25: FUN(X[[i]], ...)
  26: push.vp.vpTree(X[[i]], ...)
  27: push.vp(vp$parent, recording)
  28: push.vp.viewport(vp$parent, recording)
  29: grid.Call.graphics(C_setviewport, vp, TRUE)
  
  ── 5. Error: only one feature (@test_plot_features.R#40)  ──────────────────────
  VECTOR_ELT() can only be applied to a 'list', not a 'double'
  1: checkmate::expect_class(plotFeatures(list("V1", "V1")), classes = c("gg", "ggplot"), 
         null.ok = FALSE) at testthat/test_plot_features.R:40
  2: checkClass(x, classes, ordered, null.ok)
  3: plotFeatures(list("V1", "V1"))
  4: cowplot::insert_yaxis_grob(final.plot, dendro.repls, grid::unit(0.2, "null"), position = "right")
  5: plot_to_gtable(plot)
  6: ggplot2::ggplotGrob(plot)
  7: ggplot_gtable(ggplot_build(x))
  8: ggplot_gtable.ggplot_built(ggplot_build(x))
  9: build_guides(plot$scales, plot$layers, plot$mapping, position, theme, plot$guides, 
         plot$labels)
  10: guides_gengrob(gdefs, theme)
  ...
  20: pushvpgp(x)
  21: pushgrobvp(x$vp)
  22: pushgrobvp.viewport(x$vp)
  23: pushViewport(vp, recording = FALSE)
  24: lapply(vps, push.vp, recording)
  25: FUN(X[[i]], ...)
  26: push.vp.vpTree(X[[i]], ...)
  27: push.vp(vp$parent, recording)
  28: push.vp.viewport(vp$parent, recording)
  29: grid.Call.graphics(C_setviewport, vp, TRUE)
  
  ── 6. Error: numeric features + sim.mat (@test_plot_features.R#47)  ────────────
  VECTOR_ELT() can only be applied to a 'list', not a 'double'
  1: checkmate::expect_class(plotFeatures(list(c(2, 3, 5, 6, 7), 1:5, 2:7), sm), classes = c("gg", 
         "ggplot"), null.ok = FALSE) at testthat/test_plot_features.R:47
  2: checkClass(x, classes, ordered, null.ok)
  3: plotFeatures(list(c(2, 3, 5, 6, 7), 1:5, 2:7), sm)
  4: cowplot::insert_yaxis_grob(final.plot, dendro.repls, grid::unit(0.2, "null"), position = "right")
  5: plot_to_gtable(plot)
  6: ggplot2::ggplotGrob(plot)
  7: ggplot_gtable(ggplot_build(x))
  8: ggplot_gtable.ggplot_built(ggplot_build(x))
  9: build_guides(plot$scales, plot$layers, plot$mapping, position, theme, plot$guides, 
         plot$labels)
  10: guides_gengrob(gdefs, theme)
  ...
  20: pushvpgp(x)
  21: pushgrobvp(x$vp)
  22: pushgrobvp.viewport(x$vp)
  23: pushViewport(vp, recording = FALSE)
  24: lapply(vps, push.vp, recording)
  25: FUN(X[[i]], ...)
  26: push.vp.vpTree(X[[i]], ...)
  27: push.vp(vp$parent, recording)
  28: push.vp.viewport(vp$parent, recording)
  29: grid.Call.graphics(C_setviewport, vp, TRUE)
  
  ── 7. Error: character features + sim.mat (@test_plot_features.R#52)  ──────────
  VECTOR_ELT() can only be applied to a 'list', not a 'double'
  1: checkmate::expect_class(plotFeatures(list(paste0("V", c(2, 3, 5, 6, 7)), paste0("V", 
         1:5), paste0("V", 2:7)), sm2), classes = c("gg", "ggplot"), null.ok = FALSE) at testthat/test_plot_features.R:52
  2: checkClass(x, classes, ordered, null.ok)
  3: plotFeatures(list(paste0("V", c(2, 3, 5, 6, 7)), paste0("V", 1:5), paste0("V", 2:7)), 
         sm2)
  4: cowplot::insert_yaxis_grob(final.plot, dendro.repls, grid::unit(0.2, "null"), position = "right")
  5: plot_to_gtable(plot)
  6: ggplot2::ggplotGrob(plot)
  7: ggplot_gtable(ggplot_build(x))
  8: ggplot_gtable.ggplot_built(ggplot_build(x))
  9: build_guides(plot$scales, plot$layers, plot$mapping, position, theme, plot$guides, 
         plot$labels)
  10: guides_gengrob(gdefs, theme)
  ...
  20: pushvpgp(x)
  21: pushgrobvp(x$vp)
  22: pushgrobvp.viewport(x$vp)
  23: pushViewport(vp, recording = FALSE)
  24: lapply(vps, push.vp, recording)
  25: FUN(X[[i]], ...)
  26: push.vp.vpTree(X[[i]], ...)
  27: push.vp(vp$parent, recording)
  28: push.vp.viewport(vp$parent, recording)
  29: grid.Call.graphics(C_setviewport, vp, TRUE)
  
  ── 8. Error: one of three empty + sim.mat (@test_plot_features.R#58)  ──────────
  VECTOR_ELT() can only be applied to a 'list', not a 'double'
  1: checkmate::expect_class(plotFeatures(list(paste0("V", c(2, 3, 5, 6, 7)), paste0("V", 
         1:5), character(0L)), sm2), classes = c("gg", "ggplot"), null.ok = FALSE) at testthat/test_plot_features.R:58
  2: checkClass(x, classes, ordered, null.ok)
  3: plotFeatures(list(paste0("V", c(2, 3, 5, 6, 7)), paste0("V", 1:5), character(0L)), 
         sm2)
  4: cowplot::insert_yaxis_grob(final.plot, dendro.repls, grid::unit(0.2, "null"), position = "right")
  5: plot_to_gtable(plot)
  6: ggplot2::ggplotGrob(plot)
  7: ggplot_gtable(ggplot_build(x))
  8: ggplot_gtable.ggplot_built(ggplot_build(x))
  9: build_guides(plot$scales, plot$layers, plot$mapping, position, theme, plot$guides, 
         plot$labels)
  10: guides_gengrob(gdefs, theme)
  ...
  20: pushvpgp(x)
  21: pushgrobvp(x$vp)
  22: pushgrobvp.viewport(x$vp)
  23: pushViewport(vp, recording = FALSE)
  24: lapply(vps, push.vp, recording)
  25: FUN(X[[i]], ...)
  26: push.vp.vpTree(X[[i]], ...)
  27: push.vp(vp$parent, recording)
  28: push.vp.viewport(vp$parent, recording)
  29: grid.Call.graphics(C_setviewport, vp, TRUE)
  
  ── 9. Error: one of two empty + sim.mat (@test_plot_features.R#64)  ────────────
  VECTOR_ELT() can only be applied to a 'list', not a 'double'
  1: checkmate::expect_class(plotFeatures(list("V1", character(0L)), sm2), classes = c("gg", 
         "ggplot"), null.ok = FALSE) at testthat/test_plot_features.R:64
  2: checkClass(x, classes, ordered, null.ok)
  3: plotFeatures(list("V1", character(0L)), sm2)
  4: cowplot::insert_yaxis_grob(final.plot, dendro.repls, grid::unit(0.2, "null"), position = "right")
  5: plot_to_gtable(plot)
  6: ggplot2::ggplotGrob(plot)
  7: ggplot_gtable(ggplot_build(x))
  8: ggplot_gtable.ggplot_built(ggplot_build(x))
  9: build_guides(plot$scales, plot$layers, plot$mapping, position, theme, plot$guides, 
         plot$labels)
  10: guides_gengrob(gdefs, theme)
  ...
  20: pushvpgp(x)
  21: pushgrobvp(x$vp)
  22: pushgrobvp.viewport(x$vp)
  23: pushViewport(vp, recording = FALSE)
  24: lapply(vps, push.vp, recording)
  25: FUN(X[[i]], ...)
  26: push.vp.vpTree(X[[i]], ...)
  27: push.vp(vp$parent, recording)
  28: push.vp.viewport(vp$parent, recording)
  29: grid.Call.graphics(C_setviewport, vp, TRUE)
  
  ── 10. Error: only one feature + sim.mat (@test_plot_features.R#69)  ───────────
  VECTOR_ELT() can only be applied to a 'list', not a 'double'
  1: checkmate::expect_class(plotFeatures(list("V1", "V1"), sm2), classes = c("gg", "ggplot"), 
         null.ok = FALSE) at testthat/test_plot_features.R:69
  2: checkClass(x, classes, ordered, null.ok)
  3: plotFeatures(list("V1", "V1"), sm2)
  4: cowplot::insert_yaxis_grob(final.plot, dendro.repls, grid::unit(0.2, "null"), position = "right")
  5: plot_to_gtable(plot)
  6: ggplot2::ggplotGrob(plot)
  7: ggplot_gtable(ggplot_build(x))
  8: ggplot_gtable.ggplot_built(ggplot_build(x))
  9: build_guides(plot$scales, plot$layers, plot$mapping, position, theme, plot$guides, 
         plot$labels)
  10: guides_gengrob(gdefs, theme)
  ...
  20: pushvpgp(x)
  21: pushgrobvp(x$vp)
  22: pushgrobvp.viewport(x$vp)
  23: pushViewport(vp, recording = FALSE)
  24: lapply(vps, push.vp, recording)
  25: FUN(X[[i]], ...)
  26: push.vp.vpTree(X[[i]], ...)
  27: push.vp(vp$parent, recording)
  28: push.vp.viewport(vp$parent, recording)
  29: grid.Call.graphics(C_setviewport, vp, TRUE)
  
  ══ testthat results  ═══════════════════════════════════════════════════════════
  OK: 241 SKIPPED: 0 FAILED: 10
  1.  Error: numeric features (@test_plot_features.R#13) 
  2.  Error: character features (@test_plot_features.R#18) 
  3.  Error: one of three empty (@test_plot_features.R#24) 
  4.  Error: one of two empty (@test_plot_features.R#30) 
  5.  Error: only one feature (@test_plot_features.R#40) 
  6.  Error: numeric features + sim.mat (@test_plot_features.R#47) 
  7.  Error: character features + sim.mat (@test_plot_features.R#52) 
  8.  Error: one of three empty + sim.mat (@test_plot_features.R#58) 
  9.  Error: one of two empty + sim.mat (@test_plot_features.R#64) 
  10. Error: only one feature + sim.mat (@test_plot_features.R#69) 
  
  Error: testthat unit tests failed
  Execution halted