File: test-geom-freqpoly.R

package info (click to toggle)
r-cran-ggplot2 3.3.3%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 8,184 kB
  • sloc: sh: 15; makefile: 5
file content (12 lines) | stat: -rw-r--r-- 329 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
context("geom_freqpoly")

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, new_mapped_discrete(1:3))
  expect_equal(d$y, 3:1)
})