test_that("interval_vctr can survive", {
df <- data.frame(
x = interval(1:3, 3:5),
y = 1:3
)
g <- ggplot(df, aes(xmin = x, xmax = x,
ymin = y - 0.4, ymax = y + 0.4)) +
geom_rect() +
coord_cartesian_vctr()
ld <- layer_data(g)
expect_is(ld$xmin, "interval_vctr")
expect_is(ld$xmax, "interval_vctr")
grob <- layer_grob(g)[[1]]
expect_equal(length(grob$x), 3L)
expect_equal(length(grob$width), 3L)
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.