tests/testthat/test-stat-qq.R

test_that("error is thrown with wrong quantile input", {
  # Stat errors are converted to warnings
  p <- ggplot(mtcars, aes(sample = mpg)) + stat_qq(quantiles = 1:5)
  expect_snapshot_warning(ggplot_build(p))

  p <- ggplot(mtcars, aes(sample = mpg)) + geom_qq_line(quantiles = 1:5)
  expect_snapshot_warning(ggplot_build(p))

  p <- ggplot(mtcars, aes(sample = mpg)) + geom_qq_line(line.p = 0.15)
  expect_snapshot_warning(ggplot_build(p))
})

Try the ggplot2 package in your browser

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

ggplot2 documentation built on Oct. 12, 2023, 5:08 p.m.