File: test-ggplot-hex.R

package info (click to toggle)
r-cran-plotly 4.10.4%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 30,636 kB
  • sloc: javascript: 195,272; sh: 24; makefile: 6
file content (23 lines) | stat: -rw-r--r-- 599 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
d <- ggplot(diamonds, aes(carat, price))

test_that("geom_hex", {
  skip_if_not_installed("hexbin")
  g <- d + geom_hex()
  l <- expect_doppelganger_built(g, "hex-basic")
  expect_true(length(l$data) > 1)
})


test_that("geom_hex with bins", {
  skip_if_not_installed("hexbin")
  g <- d + geom_hex(bins = 10)
  l <- expect_doppelganger_built(g, "hex-bins")
  expect_true(length(l$data) > 1)
})

test_that("geom_hex with binwidth", {
  skip_if_not_installed("hexbin")
  g <- d + geom_hex(binwidth = c(1, 1000))
  l <- expect_doppelganger_built(g, "hex-binwidth")
  expect_true(length(l$data) > 1)
})