Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[R-Forge #2611] := shouldn't print in knitr #505

Closed
arunsrinivasan opened this issue Jun 8, 2014 · 1 comment
Closed

[R-Forge #2611] := shouldn't print in knitr #505

arunsrinivasan opened this issue Jun 8, 2014 · 1 comment
Assignees
Labels
Milestone

Comments

@arunsrinivasan
Copy link
Member

Submitted by: Matt Dowle; Assigned to: Nobody; R-Forge link

As raised on SO here

@mattdowle mattdowle self-assigned this Oct 20, 2014
@mattdowle mattdowle added this to the v1.9.6 milestone Oct 20, 2014
@mattdowle mattdowle changed the title [R-Forge #2611] Full compatibility with knitr [R-Forge #2611] := shouldn't print in knitr Oct 21, 2014
@rubenarslan
Copy link

In conjunction with using dplyr on a data.table, this still happens. Presumably the error can also occur when other classes remove data.table from being the pole position class.

Here's a reproducible Rmd file:

`:=` 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]

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants