tests/testthat/test-write_fig.R

test_that("write_fig works", {
    library(ggplot2)
    p <- ggplot(mpg, aes(class, hwy))
    p1 <- p + geom_boxplot()
    
    expect_true({
        write_fig(p1, "Fig1. a", show = FALSE)
        write_fig(p1, "a.svg", show = FALSE)
        write_fig(p1, "a.pdf", show = FALSE)
        write_fig(p1, "a.tif", show = FALSE)
        dev_off()
        TRUE    
    })
})
rpkgs/Ipaper documentation built on March 24, 2024, 3:09 p.m.