tests/testthat/helper-ggplot.R

# R 4.1 cannot dispatch `plot + data` past `Ops.data.frame`. Calling ggplot2's
# public double-dispatch generic exercises the same data replacement at the R
# floor and on current R.
replace_plot_data <- function(plot, data) {
  ggplot2::update_ggplot(data, plot)
}

Try the coursekata package in your browser

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

coursekata documentation built on Sept. 22, 2026, 1:08 a.m.