Skip to content

Commit

Permalink
replace vec_slice() (#6297)
Browse files Browse the repository at this point in the history
  • Loading branch information
teunbrand authored Jan 28, 2025
1 parent aeaed9a commit 8ef9c6e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion R/facet-grid-.R
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,9 @@ FacetGrid <- ggproto("FacetGrid", Facet,
params$margins
)
# Apply recycling on original data to fit margins
data <- vec_slice(data, facet_vals$.index)
# We're using base subsetting here because `data` might have a superclass
# that isn't handled well by vctrs::vec_slice
data <- data[facet_vals$.index, , drop = FALSE]
facet_vals$.index <- NULL
}

Expand Down

0 comments on commit 8ef9c6e

Please sign in to comment.