Unwanted console output from data.table in R Notebook when using walrus operator (:=) in j argument to modify columns in place

Recently presumably from an update when using data.table in an R Notebook (RStudio), data.tables have been prinitng themselves to the console when I use the walrus operator to modify or create a column in place, e.g,

dt[, newcol := oldcol + 5]

This now prints the resulting data.table out in the console, when this used to not happen. I'm aware that I could use

dt <- dt[, newcol := oldcol + 5]

or invisible() to silence this, but my problem is, I maintain a big library of R Notebooks that all have nice, pretty output, I'd like to not have to change every single line that uses this.

Is this an update to data.table, and is there a global way to silence these messages? Can I hope it goes away in a future version?

I'm using R 4.5.3, data.table 1.18.2.1 and RStudio 2026.01.1 Build 403

UPDATE: Tested on R 4.6.0, data.table 1.18.2.1 and RStudio 2026.04.0 Build 246 still saw the same behavior.

Console output from running in a code chunk in an .Rmd file:

> library(data.table)
> dt <- data.table()
> dt[, a := 1]
       a
   <num>
1:     1
> 

And below the code chunk:

Typing directly into the console:

> dt[, b := 2]
> 

No console output is seen.

1 Like

I just did a package update and we now have {data.table 1.18.4}. You might want to give it a try.

1 Like