Closed
Description
Due to the fortify method for <tbl> objects, {dplyr} is require for plotting with non-tibble <tbl> classes:
Lines 19 to 22 in 0e64d9c
I view {pillar} and the <tbl> subclass as mainly for formatting so wondered if it would be possible to simply dispatch to the next data.frame method and have explicit methods for other <tbl> sub-classes that need supporting separately.
I've also raised this in the pillar repo to get their opinion of how best to view the class.
Hope this all makes sense. Example below (on install where dplyr is removed)
library(tibble)
library(ggplot2)
x <- y <- 1:2
tbl <- dat <- data.frame(x, y)
class(tbl) <- c("tbl", "data.frame")
tbl
#> # A data frame: 2 × 2
#> x y
#> <int> <int>
#> 1 1 1
#> 2 2 2
# this errors
ggplot(tbl, aes(x,y)) + geom_col()
#> Error: dplyr must be installed to work with tbl objects
# this will print ok
ggplot(as_tibble(dat), aes(x,y)) + geom_col()
Created on 2022-03-31 by the reprex package (v2.0.1)