File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -82,6 +82,17 @@ test_that("inherit.aes works", {
82
82
expect_identical(p1 $ layers [[1 ]]$ computed_mapping , p2 $ layers [[1 ]]$ computed_mapping )
83
83
})
84
84
85
+ test_that(" retransform works on computed aesthetics in `map_statistic`" , {
86
+ df <- data.frame (x = rep(c(1 ,2 ), c(9 , 25 )))
87
+ p <- ggplot(df , aes(x )) + geom_bar() + scale_y_sqrt()
88
+ expect_equal(layer_data(p )$ y , c(3 , 5 ))
89
+
90
+ # To double check: should be original values when `retransform = FALSE`
91
+ parent <- p $ layers [[1 ]]$ stat
92
+ p $ layers [[1 ]]$ stat <- ggproto(NULL , parent , retransform = FALSE )
93
+ expect_equal(layer_data(p )$ y , c(9 , 25 ))
94
+ })
95
+
85
96
# Data extraction ---------------------------------------------------------
86
97
87
98
test_that(" layer_data returns a data.frame" , {
You can’t perform that action at this time.
0 commit comments