Skip to content

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

Closed

Description

@arunsrinivasan

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

As raised on SO here

Activity

  1. self-assigned this
    on Oct 20, 2014
  2. added this to the v1.9.6 milestone on Oct 20, 2014
  3. changed the title [-][R-Forge #2611] Full compatibility with knitr[/-] [+][R-Forge #2611] := shouldn't print in knitr[/+] on Oct 21, 2014
  4. rubenarslan commented on Feb 20, 2015

    @rubenarslan

    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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions