tests/testthat/test-ggplot-device.R

test_that("ggplotly doesn't leave a new device open", {
  devList1 <- dev.list()
  p <- ggplotly(ggplot(mtcars) + geom_point(aes(wt, mpg)))
  devList2 <- dev.list()
  expect_true(length(devList1) == length(devList2))
})

Try the plotly package in your browser

Any scripts or data that you put into this service are public.

plotly documentation built on May 29, 2024, 2:23 a.m.