You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> packageVersion("data.table")
[1] ‘1.9.7’
> x = data.table(a=1:3)
> truelength(x)
[1] 100
> f = function(DT) {
+ for (i in 1:200) {
+ DT[,paste0("new",i):=1:3]
+ }
+ }
> f(x) # I thought there was a warning here that := on i==100 did a realloc
> dim(x)
[1] 3 100 # wrong result
> f = function(DT) {
+ for (i in 1:200) {
+ DT[,paste0("new",i):=1:3]
+ }
+ DT # needed in this case
+ }
> x = f(x) # x= needed in this case
> dim(x)
[1] 3 201 # correct result
I seem to remember there was a warning. Maybe it isn't happening in this case for some reason. Need to reinstate the warning and add a test for it.
The text was updated successfully, but these errors were encountered:
I seem to remember there was a warning. Maybe it isn't happening in this case for some reason. Need to reinstate the warning and add a test for it.
The text was updated successfully, but these errors were encountered: