test_that("scale_x_vctr can be added to a plot", {
g <- ggplot(iris, aes(Sepal.Width, Sepal.Length)) +
geom_point()
# Test object can be created
sc <- scale_x_vctr()
expect_is(sc, "ScaleContinuousVctr")
# Test object is added to plot
test <- g + sc
expect_is(test$scales$get_scales("x"), "ScaleContinuousVctr")
# Test plot can be build without errors
expr <- substitute(ggplotGrob(test))
expect_silent(eval(expr))
})
test_that("scale_y_vctr can be added to a plot", {
g <- ggplot(iris, aes(Sepal.Width, Sepal.Length)) +
geom_point()
# Test object can be created
sc <- scale_y_vctr()
expect_is(sc, "ScaleContinuousVctr")
# Test object is added to plot
test <- g + sc
expect_is(test$scales$get_scales("y"), "ScaleContinuousVctr")
# Test plot can be build without errors
expr <- substitute(ggplotGrob(test))
expect_silent(eval(expr))
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.