Update plot interaction for ggplot2 > 2.2.1

This commit is contained in:
Winston Chang
2017-02-09 11:01:47 -06:00
parent 3479a4661a
commit fe943b5e95
2 changed files with 213 additions and 73 deletions

View File

@@ -60,17 +60,17 @@ test_that("ggplot coordmap", {
dev.off()
# Check mapping vars
expect_equal(m[[1]]$mapping, list(x = "xvar", y = "yvar"))
expect_equal(sortList(m[[1]]$mapping), list(x = "xvar", y = "yvar"))
# Plot with computed variable (histogram)
p <- ggplot(dat, aes(xvar)) + geom_histogram(binwidth=1)
# Plot with an expression in aes, and a computed variable (histogram)
p <- ggplot(dat, aes(xvar/2)) + geom_histogram(binwidth=1)
png(tmpfile)
m <- getGgplotCoordmap(print(p), 1, 72)
dev.off()
# Check mapping vars - no value for y
expect_equal(m[[1]]$mapping, list(x = "xvar", y = NULL))
expect_equal(sortList(m[[1]]$mapping), list(x = "xvar/2", y = NULL))
})