You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I left this as a comment on a closed data.table issue previously, that probably was a bad idea. I think this might have to be fixed on the dplyr side, since the solution in data.table lives in the print.data.table function, which isn't called when "grouped_dt" is in the pole position.
The bug Rdatatable/data.table#505 happens when e.g. dplyr::group_by was used on a data.table. Presumably the error can also occur when other classes remove data.table from being the pole position class.
Here's a failing test:
cat(knit(text='`:=` prints in conjunction with dplyr, because dplyr adds all kind of classes to data.tables
```{r}
library(dplyr); library(data.table)
mtcars = data.table(mtcars)
grouped = mtcars %>% group_by(cyl)
grouped[, mpg := 2]
class(grouped)
class(grouped) = c("data.table", "grouped_dt", "tbl_dt", "tbl", "data.frame") # reorder classes
grouped[, mpg := 2]
# this is how I currently "fix" it.
grouped = mtcars %>% group_by(cyl) %>% data.table()
grouped[, mpg := 2]
class(grouped)
```'))
This is with data.table_1.9.5, dplyr_0.4.1 and knitr_1.9.
The text was updated successfully, but these errors were encountered:
Sorry, I didn't mean to suggest your class names shouldn't come first – but if dplyr is extending the dt class, it would be better if printing didn't break when dt functionality (:=) is later used.
I left this as a comment on a closed data.table issue previously, that probably was a bad idea. I think this might have to be fixed on the dplyr side, since the solution in data.table lives in the print.data.table function, which isn't called when "grouped_dt" is in the pole position.
The bug Rdatatable/data.table#505 happens when e.g. dplyr::group_by was used on a data.table. Presumably the error can also occur when other classes remove data.table from being the pole position class.
Here's a failing test:
This is with data.table_1.9.5, dplyr_0.4.1 and knitr_1.9.
The text was updated successfully, but these errors were encountered: