Skip to content

Commit 7ae5358

Browse files
committed
use integers to select panels
1 parent f7feb8c commit 7ae5358

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

R/facet-.R

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,12 @@ Facet <- ggproto("Facet", NULL,
170170
# Add PANEL variable
171171
keys <- join_keys(facet_vals, layout, by = names(vars))
172172
data$PANEL <- layout$PANEL[match(keys$x, keys$y)]
173+
174+
# Filter panels when layer_layout is an integer
175+
if (is_integerish(layer_layout)) {
176+
data <- vec_slice(data, data$PANEL %in% layer_layout)
177+
}
178+
173179
data
174180
},
175181
init_scales = function(layout, x_scale = NULL, y_scale = NULL, params) {

0 commit comments

Comments
 (0)