Skip to content

Commit af1a558

Browse files
thomasp85hadley
authored andcommitted
Correct result length in vapply + only throw warning when scales not free (#2628)
1 parent 4b609fb commit af1a558

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

R/facet-wrap.r

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,14 +297,16 @@ FacetWrap <- ggproto("FacetWrap", Facet,
297297
col_axes <- axes$y$right[layout$SCALE_Y[col_panels]]
298298
if (params$strip.position == "bottom" &&
299299
theme$strip.placement != "inside" &&
300-
any(!vapply(row_axes, is.zero, logical(length(row_axes))))) {
300+
any(!vapply(row_axes, is.zero, logical(1))) &&
301+
!params$free$x) {
301302
warning("Suppressing axis rendering when strip.position = 'bottom' and strip.placement == 'outside'", call. = FALSE)
302303
} else {
303304
axis_mat_x_bottom[row_pos] <- row_axes
304305
}
305306
if (params$strip.position == "right" &&
306307
theme$strip.placement != "inside" &&
307-
any(!vapply(col_axes, is.zero, logical(length(col_axes))))) {
308+
any(!vapply(col_axes, is.zero, logical(1))) &&
309+
!params$free$y) {
308310
warning("Suppressing axis rendering when strip.position = 'right' and strip.placement == 'outside'", call. = FALSE)
309311
} else {
310312
axis_mat_y_right[col_pos] <- col_axes

0 commit comments

Comments
 (0)