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.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…