markvanderloo · GitHub

The following behaviour is inconsistent from the user's perspective

> class(group_by(iris, Species)[ , "Sepal.Width", drop=TRUE])
[1] "tbl_df"     "tbl"        "data.frame"
> class(as_tibble(iris)[ , "Sepal.Width", drop=TRUE])
[1] "numeric"

I understand that group_by creates a different subclass of tbl than as_tibble does, but for user experience I think that having consistent selection operators would be preferred.

My personal take: support drop=TRUE since that is more consistent with the generic [ method.

I ran into this because a user of one of my packages supplied a tibble object to a function while all my tests are on data frames.

Read the original on github.com ↗