Running ‘testthat.R’ [4s/5s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(ggsignif)
  > 
  > test_check("ggsignif")
  ── 1. Error: the plotting works (@test-significance_annotation.R#7)  ───────────
  VECTOR_ELT() can only be applied to a 'list', not a 'double'
  1: print(ggplot(mpg, aes(x = manufacturer, y = displ)) + geom_boxplot() + stat_signif(comparisons = list(c("audi", 
         "ford"), c("hyundai", "nissan")), map_signif_level = TRUE, test = "wilcox.test", 
         test.args = list(alternative = "two.sided"), margin_top = 0.02, step_increase = 0, 
         tip_length = 0.01) + theme(axis.text.x = element_text(angle = 90, hjust = 1)) + 
         facet_wrap(~as.factor(year), scale = "free")) at testthat/test-significance_annotation.R:7
  2: print.ggplot(ggplot(mpg, aes(x = manufacturer, y = displ)) + geom_boxplot() + stat_signif(comparisons = list(c("audi", 
         "ford"), c("hyundai", "nissan")), map_signif_level = TRUE, test = "wilcox.test", 
         test.args = list(alternative = "two.sided"), margin_top = 0.02, step_increase = 0, 
         tip_length = 0.01) + theme(axis.text.x = element_text(angle = 90, hjust = 1)) + 
         facet_wrap(~as.factor(year), scale = "free"))
  3: ggplot_gtable(data)
  4: ggplot_gtable.ggplot_built(data)
  5: layout$render(geom_grobs, data, theme, plot$labels)
  6: f(..., self = self)
  7: 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)
  8: f(...)
  9: render_strips(structure(labels_df, type = "rows"), structure(labels_df, type = "cols"), 
         params$labeller, theme)
  10: build_strip(x, labeller, theme, TRUE)
  11: ggstrip(grobs, theme, element, gp, horizontal, clip = "on")
  12: Summary.unit(structure(c(4.4, 4.4), unit = 8L, class = c("margin", "unit")), na.rm = FALSE)
  
  ── 2. Error: geom works as well as stat works (@test-significance_annotation.R#2
  VECTOR_ELT() can only be applied to a 'list', not a 'double'
  1: print(ggplot(mpg, aes(x = manufacturer, y = displ)) + geom_boxplot() + geom_signif(comparisons = list(c("audi", 
         "ford"), c("hyundai", "nissan")), annotations = c("Interesting", "Too far apart"), 
         test = "wilcox.test", test.args = list(alternative = "two.sided"), margin_top = 0.02, 
         step_increase = 0, tip_length = 0.01) + theme(axis.text.x = element_text(angle = 90, 
         hjust = 1)) + facet_wrap(~as.factor(year), scale = "free")) at testthat/test-significance_annotation.R:21
  2: print.ggplot(ggplot(mpg, aes(x = manufacturer, y = displ)) + geom_boxplot() + geom_signif(comparisons = list(c("audi", 
         "ford"), c("hyundai", "nissan")), annotations = c("Interesting", "Too far apart"), 
         test = "wilcox.test", test.args = list(alternative = "two.sided"), margin_top = 0.02, 
         step_increase = 0, tip_length = 0.01) + theme(axis.text.x = element_text(angle = 90, 
         hjust = 1)) + facet_wrap(~as.factor(year), scale = "free"))
  3: ggplot_gtable(data)
  4: ggplot_gtable.ggplot_built(data)
  5: layout$render(geom_grobs, data, theme, plot$labels)
  6: f(..., self = self)
  7: 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)
  8: f(...)
  9: render_strips(structure(labels_df, type = "rows"), structure(labels_df, type = "cols"), 
         params$labeller, theme)
  10: build_strip(x, labeller, theme, TRUE)
  11: ggstrip(grobs, theme, element, gp, horizontal, clip = "on")
  12: Summary.unit(structure(c(4.4, 4.4), unit = 8L, class = c("margin", "unit")), na.rm = FALSE)
  
  ── 3. Error: non-sense gives warning (@test-significance_annotation.R#37)  ─────
  VECTOR_ELT() can only be applied to a 'list', not a 'double'
  1: expect_warning(print(ggplot(mpg, aes(y = hwy, x = displ, group = manufacturer)) + 
         geom_point() + stat_signif(comparisons = list(c("audi", "ford"), c("hyundai", 
         "nissan"))))) at testthat/test-significance_annotation.R:37
  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: print(ggplot(mpg, aes(y = hwy, x = displ, group = manufacturer)) + geom_point() + 
         stat_signif(comparisons = list(c("audi", "ford"), c("hyundai", "nissan"))))
  7: print.ggplot(ggplot(mpg, aes(y = hwy, x = displ, group = manufacturer)) + geom_point() + 
         stat_signif(comparisons = list(c("audi", "ford"), c("hyundai", "nissan"))))
  8: grid.draw(gtable)
  9: grid.draw.gTree(gtable)
  10: recordGraphics(drawGTree(x), list(x = x), getNamespace("grid"))
  11: drawGTree(x)
  12: preDraw(x)
  13: preDraw.gTree(x)
  14: pushvpgp(x)
  15: pushgrobvp(x$vp)
  16: pushgrobvp.viewport(x$vp)
  17: pushViewport(vp, recording = FALSE)
  18: lapply(vps, push.vp, recording)
  19: FUN(X[[i]], ...)
  20: push.vp.viewport(X[[i]], ...)
  21: grid.Call.graphics(C_setviewport, vp, TRUE)
  
  ── 4. Error: geom_signif with identity works (@test-significance_annotation.R#51
  VECTOR_ELT() can only be applied to a 'list', not a 'double'
  1: print(ggplot(dat, aes(Group, Value)) + geom_bar(aes(fill = Sub), stat = "identity", 
         position = "dodge", width = 0.5) + geom_signif(stat = "identity", data = data.frame(x = c(0.875, 
         1.875), xend = c(1.125, 2.125), y = c(5.8, 8.5), annotation = c("***", "NS")), 
         aes(x = x, xend = xend, y = y, yend = y, annotation = annotation)) + geom_signif(comparisons = list(c("S1", 
         "S2")), annotations = "***", y_position = 9.3, tip_length = 0) + scale_fill_manual(values = c("grey80", 
         "grey20"))) at testthat/test-significance_annotation.R:51
  2: print.ggplot(ggplot(dat, aes(Group, Value)) + geom_bar(aes(fill = Sub), stat = "identity", 
         position = "dodge", width = 0.5) + geom_signif(stat = "identity", data = data.frame(x = c(0.875, 
         1.875), xend = c(1.125, 2.125), y = c(5.8, 8.5), annotation = c("***", "NS")), 
         aes(x = x, xend = xend, y = y, yend = y, annotation = annotation)) + geom_signif(comparisons = list(c("S1", 
         "S2")), annotations = "***", y_position = 9.3, tip_length = 0) + scale_fill_manual(values = c("grey80", 
         "grey20")))
  3: ggplot_gtable(data)
  4: ggplot_gtable.ggplot_built(data)
  5: build_guides(plot$scales, plot$layers, plot$mapping, position, theme, plot$guides, 
         plot$labels)
  6: guides_gengrob(gdefs, theme)
  7: lapply(gdefs, guide_gengrob, theme)
  8: FUN(X[[i]], ...)
  9: guide_gengrob.legend(X[[i]], ...)
  10: width_cm(grob.title)
  ...
  16: pushvpgp(x)
  17: pushgrobvp(x$vp)
  18: pushgrobvp.viewport(x$vp)
  19: pushViewport(vp, recording = FALSE)
  20: lapply(vps, push.vp, recording)
  21: FUN(X[[i]], ...)
  22: push.vp.vpTree(X[[i]], ...)
  23: push.vp(vp$parent, recording)
  24: push.vp.viewport(vp$parent, recording)
  25: grid.Call.graphics(C_setviewport, vp, TRUE)
  
  ── 5. Error: you can change the linetype (@test-significance_annotation.R#66)  ─
  VECTOR_ELT() can only be applied to a 'list', not a 'double'
  1: print(ggplot(iris, aes(x = Species, y = Sepal.Length)) + geom_boxplot() + geom_signif(comparisons = list(c("versicolor", 
         "virginica")), map_signif_level = TRUE, linetype = 3, alpha = 1, color = "blue", 
         size = 1, textsize = 8) + ylim(c(NA, 8.5))) at testthat/test-significance_annotation.R:66
  2: print.ggplot(ggplot(iris, aes(x = Species, y = Sepal.Length)) + geom_boxplot() + 
         geom_signif(comparisons = list(c("versicolor", "virginica")), map_signif_level = TRUE, 
             linetype = 3, alpha = 1, color = "blue", size = 1, textsize = 8) + ylim(c(NA, 
         8.5)))
  3: grid.draw(gtable)
  4: grid.draw.gTree(gtable)
  5: recordGraphics(drawGTree(x), list(x = x), getNamespace("grid"))
  6: drawGTree(x)
  7: preDraw(x)
  8: preDraw.gTree(x)
  9: pushvpgp(x)
  10: pushgrobvp(x$vp)
  11: pushgrobvp.viewport(x$vp)
  12: pushViewport(vp, recording = FALSE)
  13: lapply(vps, push.vp, recording)
  14: FUN(X[[i]], ...)
  15: push.vp.viewport(X[[i]], ...)
  16: grid.Call.graphics(C_setviewport, vp, TRUE)
  
  ── 6. Error: identical annotations are plotted separetly (@test-significance_ann
  VECTOR_ELT() can only be applied to a 'list', not a 'double'
  1: print(ggplot(dat, aes(Group, Value)) + geom_bar(aes(fill = Sub), stat = "identity", 
         position = "dodge", width = 0.5) + geom_signif(comparisons = list(c("S1", "S2")), 
         annotations = "***", y_position = 9.3, tip_length = 0, vjust = 0.4) + geom_signif(stat = "identity", 
         data = data.frame(x = c(0.875, 1.875), xend = c(1.125, 2.125), y = c(5.8, 8.5), 
             annotation = c("**", "**")), aes(x = x, xend = xend, y = y, yend = y, annotation = annotation, 
             group = c(1, 2))) + scale_fill_manual(values = c("grey80", "grey20"))) at testthat/test-significance_annotation.R:82
  2: print.ggplot(ggplot(dat, aes(Group, Value)) + geom_bar(aes(fill = Sub), stat = "identity", 
         position = "dodge", width = 0.5) + geom_signif(comparisons = list(c("S1", "S2")), 
         annotations = "***", y_position = 9.3, tip_length = 0, vjust = 0.4) + geom_signif(stat = "identity", 
         data = data.frame(x = c(0.875, 1.875), xend = c(1.125, 2.125), y = c(5.8, 8.5), 
             annotation = c("**", "**")), aes(x = x, xend = xend, y = y, yend = y, annotation = annotation, 
             group = c(1, 2))) + scale_fill_manual(values = c("grey80", "grey20")))
  3: ggplot_gtable(data)
  4: ggplot_gtable.ggplot_built(data)
  5: build_guides(plot$scales, plot$layers, plot$mapping, position, theme, plot$guides, 
         plot$labels)
  6: guides_gengrob(gdefs, theme)
  7: lapply(gdefs, guide_gengrob, theme)
  8: FUN(X[[i]], ...)
  9: guide_gengrob.legend(X[[i]], ...)
  10: width_cm(grob.title)
  ...
  16: pushvpgp(x)
  17: pushgrobvp(x$vp)
  18: pushgrobvp.viewport(x$vp)
  19: pushViewport(vp, recording = FALSE)
  20: lapply(vps, push.vp, recording)
  21: FUN(X[[i]], ...)
  22: push.vp.vpTree(X[[i]], ...)
  23: push.vp(vp$parent, recording)
  24: push.vp.viewport(vp$parent, recording)
  25: grid.Call.graphics(C_setviewport, vp, TRUE)
  
  ── 7. Error: multiple comparisons can be made to the same element (@test-signifi
  VECTOR_ELT() can only be applied to a 'list', not a 'double'
  1: print(ggplot(data.frame(y = runif(100), x = sample(c("A", "B", "C", "D"), size = 100, 
         replace = TRUE)), aes(x = x, y = y)) + geom_boxplot() + geom_signif(comparisons = list(c(1, 
         2), c(2, 3), c(1, 3), c(1, 4), c(2, 4), c(1, 2)), step_increase = 0.1)) at testthat/test-significance_annotation.R:98
  2: print.ggplot(ggplot(data.frame(y = runif(100), x = sample(c("A", "B", "C", "D"), 
         size = 100, replace = TRUE)), aes(x = x, y = y)) + geom_boxplot() + geom_signif(comparisons = list(c(1, 
         2), c(2, 3), c(1, 3), c(1, 4), c(2, 4), c(1, 2)), step_increase = 0.1))
  3: grid.draw(gtable)
  4: grid.draw.gTree(gtable)
  5: recordGraphics(drawGTree(x), list(x = x), getNamespace("grid"))
  6: drawGTree(x)
  7: preDraw(x)
  8: preDraw.gTree(x)
  9: pushvpgp(x)
  10: pushgrobvp(x$vp)
  11: pushgrobvp.viewport(x$vp)
  12: pushViewport(vp, recording = FALSE)
  13: lapply(vps, push.vp, recording)
  14: FUN(X[[i]], ...)
  15: push.vp.viewport(X[[i]], ...)
  16: grid.Call.graphics(C_setviewport, vp, TRUE)
  
  ── 8. Error: plots with xmin, xmax work (@test-significance_annotation.R#120)  ─
  VECTOR_ELT() can only be applied to a 'list', not a 'double'
  1: print(ggplot(airquality_trimmed, aes(x = Month, y = Ozone, fill = Temp.f)) + geom_boxplot(alpha = 0.7, 
         width = 0.4) + geom_signif(y_position = 150, xmin = c(0.9, 1.9), xmax = c(1.1, 
         2.1), annotations = c("***", "NS")) + scale_y_continuous(name = "Mean ozone in\nparts per billion", 
         breaks = seq(0, 175, 25), limits = c(0, 175)) + scale_x_discrete(name = "Month") + 
         ggtitle("Boxplot of mean ozone by month") + theme_bw() + theme(plot.title = element_text(size = 14, 
         face = "bold"), text = element_text(size = 12), axis.title = element_text(face = "bold"), 
         axis.text.x = element_text(size = 11), legend.position = "bottom") + scale_fill_brewer(palette = "Accent") + 
         labs(fill = "Temperature")) at testthat/test-significance_annotation.R:120
  2: print.ggplot(ggplot(airquality_trimmed, aes(x = Month, y = Ozone, fill = Temp.f)) + 
         geom_boxplot(alpha = 0.7, width = 0.4) + geom_signif(y_position = 150, xmin = c(0.9, 
         1.9), xmax = c(1.1, 2.1), annotations = c("***", "NS")) + scale_y_continuous(name = "Mean ozone in\nparts per billion", 
         breaks = seq(0, 175, 25), limits = c(0, 175)) + scale_x_discrete(name = "Month") + 
         ggtitle("Boxplot of mean ozone by month") + theme_bw() + theme(plot.title = element_text(size = 14, 
         face = "bold"), text = element_text(size = 12), axis.title = element_text(face = "bold"), 
         axis.text.x = element_text(size = 11), legend.position = "bottom") + scale_fill_brewer(palette = "Accent") + 
         labs(fill = "Temperature"))
  3: ggplot_gtable(data)
  4: ggplot_gtable.ggplot_built(data)
  5: build_guides(plot$scales, plot$layers, plot$mapping, position, theme, plot$guides, 
         plot$labels)
  6: guides_gengrob(gdefs, theme)
  7: lapply(gdefs, guide_gengrob, theme)
  8: FUN(X[[i]], ...)
  9: guide_gengrob.legend(X[[i]], ...)
  10: width_cm(grob.title)
  ...
  16: pushvpgp(x)
  17: pushgrobvp(x$vp)
  18: pushgrobvp.viewport(x$vp)
  19: pushViewport(vp, recording = FALSE)
  20: lapply(vps, push.vp, recording)
  21: FUN(X[[i]], ...)
  22: push.vp.vpTree(X[[i]], ...)
  23: push.vp(vp$parent, recording)
  24: push.vp.viewport(vp$parent, recording)
  25: grid.Call.graphics(C_setviewport, vp, TRUE)
  
  ══ testthat results  ═══════════════════════════════════════════════════════════
  OK: 9 SKIPPED: 1 FAILED: 8
  1. Error: the plotting works (@test-significance_annotation.R#7) 
  2. Error: geom works as well as stat works (@test-significance_annotation.R#21) 
  3. Error: non-sense gives warning (@test-significance_annotation.R#37) 
  4. Error: geom_signif with identity works (@test-significance_annotation.R#51) 
  5. Error: you can change the linetype (@test-significance_annotation.R#66) 
  6. Error: identical annotations are plotted separetly (@test-significance_annotation.R#82) 
  7. Error: multiple comparisons can be made to the same element (@test-significance_annotation.R#98) 
  8. Error: plots with xmin, xmax work (@test-significance_annotation.R#120) 
  
  Error: testthat unit tests failed
  Execution halted