tests/testthat/helper-snapshot.R

# Shared helpers for snapshot tests

to_grviz <- function(x) {
  path <- tempfile(fileext = ".gv")
  x <- gsub("\u2022", "", x)
  cat(x, file = path)
  path
}

save_png <- function(x, width = 9, height = 9) {
  path <- tempfile(fileext = ".png")
  png(path, width = width, height = height,
      units = "in", type = "cairo-png", res = 300)
  on.exit(dev.off())
  plot(x)
  path
}

Try the consort package in your browser

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

consort documentation built on Oct. 5, 2026, 9:08 a.m.