File: test-geom-freqpoly.R

package info (click to toggle)
r-cran-ggplot2 3.4.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 8,748 kB
  • sloc: sh: 15; makefile: 5
file content (10 lines) | stat: -rw-r--r-- 299 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
test_that("can do frequency polygon with categorical x", {
  df <- data_frame(x = rep(letters[1:3], 3:1))

  p <- ggplot(df, aes(x)) + geom_freqpoly(stat = "count")
  d <- layer_data(p)

  expect_s3_class(d$x, "mapped_discrete")
  expect_equal(d$x, mapped_discrete(1:3))
  expect_equal(d$y, 3:1)
})