Closed
Description
This problem was identified in #6287 and affects 3 packages.
Essentially, when you're dealing with a data.frame
superclass (rather than a subclass), vec_slice()
complains.
vctrs::vec_slice(mtcars, 1)
#> mpg cyl disp hp drat wt qsec vs am gear carb
#> Mazda RX4 21 6 160 110 3.9 2.62 16.46 0 1 4 4
df <- mtcars
class(df) <- union(class(df), "foo")
vctrs::vec_slice(df, 1)
#> Error in `vctrs::vec_slice()`:
#> ! `x` must be a vector, not a <data.frame/foo> object.
Created on 2025-01-22 with reprex v2.1.1
This normally doesn't happen because we rebuild our own plain data.frame after evaluating aesthetics, but it becomes a problem before that when mapping facets:
Line 312 in 97edd62
Metadata
Metadata
Assignees
Labels
No labels