tests/testthat/test-draw_key_hdr_boxplot.R

# Setting of legend key glyphs has to be tested visually
context("Legend key glyphs")
library(ggplot2)
test_that("alternative key glyphs work", {
  set.seed(5)
  hdr_boxplot <- ggplot(faithful, aes(y = eruptions)) +
    geom_hdr_boxplot(key_glyph = draw_key_hdr_boxplot) +
    theme_bw()

  # specify key glyph by function
  vdiffr::expect_doppelganger(
    "hdr key glyphs",
    hdr_boxplot
  )
})

Try the gghdr package in your browser

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

gghdr documentation built on Oct. 29, 2022, 1:16 a.m.