We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a1c70b4 commit 2fb00ffCopy full SHA for 2fb00ff
tests/testthat/test-ggplot-errorbar.R
@@ -16,3 +16,22 @@ test_that("geom_errorbar gives errorbars", {
16
# right data for errorbar ymax
17
expect_equal(L$data[[1]]$error_y$array, c(3.74, 1.26, 1.15))
18
})
19
+
20
+df <- data.frame(
21
+ trt = factor(c(1, 1, 2, 2)),
22
+ resp = c(1, 5, 3, 4),
23
+ group = factor(c(1, 2, 3, 4)),
24
+ upper = c(1.1, 5.3, 3.3, 4.2),
25
+ lower = c(0.8, 4.6, 2.4, 3.6)
26
+)
27
28
+p <- ggplot(df, aes(trt, resp, colour = group))
29
+g <- p + geom_errorbar(aes(ymin = lower, ymax = upper))
30
31
+test_that("geom_errorbar boxes an array of length 1", {
32
+ L <- save_outputs(g, "errorbar-unique-groups")
33
+ expect_true(inherits(L$data[[1]]$error_y$array, "AsIs"))
34
+ expect_true(inherits(L$data[[1]]$error_y$arrayminus, "AsIs"))
35
+})
36
37
+# TODO fix and add a test for width of errorbars
0 commit comments