data.table objects aren't updated in Rstudio environment panel

Viewed 2451

A data.table object in the environment panel will not update its preview after new variables are added using the := method. However str(dt) shows the correct details, and assigning dt to a new variable results in the correct preview in the Environment panel.

dt <- data.table(x = 1:10,
                 y = log(1:10),
                 z = (1:10)**2)
dt[, a := x + y, ]
dt[, b := x + z, ]
str(dt)
d <- dt

Is this by design, a known bug or is there a solution to this? The behavior is interesting, and I am curious as to the reason this is happening.

1 Answers
Related