« first day (1371 days earlier)      last day (1919 days later) » 

7:22 AM
hello
 
Morning all
 
Hi
 
 
7 hours later…
 
3 hours later…
5:35 PM
huh, somehow i didn't notice before that rep on a list just makes multiple pointers to the same vector. whoops:
> library(data.table)
> DT = setDT(rep(list(integer(3)), 3))
> DT[3, V1 := 9][]
   V1 V2 V3
1:  0  0  0
2:  0  0  0
3:  9  9  9
 
6:23 PM
@MrFlick I'll look into this, thanks.
@Frank Too lazy to check it out, but what happens if you change one entry in place?
 
 
1 hour later…
7:30 PM
@RomanLuštrik it edits all of the columns, like in my code block above (? maybe you're asking something else). i wonder if maybe setDT should warn when column pointers have multiple references (... i might not be using the correct terminology). fwiw, the use case is initializing a data table of zeros for github.com/Rdatatable/data.table/issues/3305
 
Doh, sorry, didn't notice you're actually modifying V1. This answers my question.
 

« first day (1371 days earlier)      last day (1919 days later) »