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    
    })
})
kongdd/Ipaper documentation built on March 27, 2024, 5:34 a.m.