@@ -82,7 +82,7 @@ test_that("facet_grid() builds correct output", {
82
82
})
83
83
84
84
test_that(" facet_grid() switches to 'x'" , {
85
- grid_x <- p + facet_grid(am ~ cyl , switch = " x " )
85
+ grid_x <- p + facet_grid(am ~ cyl , strip.position = " bottom " )
86
86
87
87
grid_x_expected <- list (
88
88
t = c(6 , 6 , 6 , 3 , 5 ),
@@ -95,7 +95,7 @@ test_that("facet_grid() switches to 'x'", {
95
95
})
96
96
97
97
test_that(" facet_grid() switches to 'y'" , {
98
- grid_y <- p + facet_grid(am ~ cyl , switch = " y " )
98
+ grid_y <- p + facet_grid(am ~ cyl , strip.position = " left " )
99
99
100
100
grid_y_expected <- list (
101
101
t = c(3 , 3 , 3 , 4 , 6 ),
@@ -108,7 +108,7 @@ test_that("facet_grid() switches to 'y'", {
108
108
})
109
109
110
110
test_that(" facet_grid() switches to both 'x' and 'y'" , {
111
- grid_xy <- p + facet_grid(am ~ cyl , switch = " both " )
111
+ grid_xy <- p + facet_grid(am ~ cyl , strip.position = c( " bottom " , " left " ) )
112
112
113
113
grid_xy_expected <- list (
114
114
t = c(6 , 6 , 6 , 3 , 5 ),
@@ -121,7 +121,7 @@ test_that("facet_grid() switches to both 'x' and 'y'", {
121
121
})
122
122
123
123
test_that(" facet_grid() warns about bad switch input" , {
124
- expect_snapshot_error(facet_grid(am ~ cyl , switch = " z" ))
124
+ expect_snapshot_error(facet_grid(am ~ cyl , strip.position = " z" ))
125
125
})
126
126
127
127
test_that(" strips can be removed" , {
@@ -165,7 +165,7 @@ test_that("padding is only added if axis is present", {
165
165
166
166
# Inverse should be true when strips are switched
167
167
p <- ggplot(data = mpg , aes(x = displ , y = hwy )) +
168
- facet_grid(year ~ drv , switch = " both " ) +
168
+ facet_grid(year ~ drv , strip.position = c( " bottom " , " left " ) ) +
169
169
theme(
170
170
strip.placement = " outside" ,
171
171
strip.switch.pad.grid = unit(10 , " mm" )
@@ -186,7 +186,7 @@ test_that("padding is only added if axis is present", {
186
186
})
187
187
188
188
test_that(" y strip labels are rotated when strips are switched" , {
189
- switched <- p + facet_grid(am ~ cyl , switch = " both " )
189
+ switched <- p + facet_grid(am ~ cyl , strip.position = c( " bottom " , " left " ) )
190
190
191
191
expect_doppelganger(" switched facet strips" , switched )
192
192
})
0 commit comments