Skip to content

Commit 8ef9c6e

Browse files
authored
replace vec_slice() (#6297)
1 parent aeaed9a commit 8ef9c6e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

R/facet-grid-.R

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,9 @@ FacetGrid <- ggproto("FacetGrid", Facet,
309309
params$margins
310310
)
311311
# Apply recycling on original data to fit margins
312-
data <- vec_slice(data, facet_vals$.index)
312+
# We're using base subsetting here because `data` might have a superclass
313+
# that isn't handled well by vctrs::vec_slice
314+
data <- data[facet_vals$.index, , drop = FALSE]
313315
facet_vals$.index <- NULL
314316
}
315317

0 commit comments

Comments
 (0)