tests/testthat/test-Position.R

pl_init(w = 4, h = 3, res = 300)

test_that("PositionFloatyPL", {
  vdiffr::expect_doppelganger(
    title = "PositionFloatyPL",
    fig = mini_diamond %>% ggplot(aes(x = cut, y = price)) +
      geom_point() +
      geom_text(aes(label = price),
        stat = "meanPL",
        lab_pos = 20000, position = position_floatyPL()
      ),
    writer = pl_svg
  )
})

test_that("PositionFloatxPL", {
  vdiffr::expect_doppelganger(
    title = "PositionFloatxPL",
    fig = mini_diamond %>% ggplot(aes(y = cut, x = price)) +
      geom_point() +
      geom_text(aes(label = price),
        stat = "meanPL",
        lab_pos = 20000, position = position_floatxPL()
      ),
    writer = pl_svg
  )
})

Try the plutor package in your browser

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

plutor documentation built on Oct. 27, 2023, 9:07 a.m.