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
I have narrowed down this to a specific dataset which I attach. It happens only when loaded from rds. If I read same data with fread the problem does not occur.
I am disguising rds file with txt extension in order to be able to upload it to github.
Any ideas of how to get around this without a copy?
devtools::session_info("data.table")
Session info ---------------------------------------------------------------------------------------------------------
setting value
version R version 3.2.4 RC (2016-03-02 r70278)
system x86_64, linux-gnu
ui X11
language
collate C
tz Europe/Amsterdam
date 2016-06-05
Packages -------------------------------------------------------------------------------------------------------------
package * version date source
data.table * 1.9.7 2016-06-01 Github (Rdatatable/data.table@6c12e25)
Thanks, I was not aware of alloc.col, but I don't see how that answers my question. The FAQ item states that the DT is re-allocated on next by reference operation with a warning. I don't see the warning.
That FAQ item indeed explains why the copy happens and why I don't see the change outside of a function call. I guess this issue then boils down to the missing warning.
tt address before: 0x7f61c6b5fc70
df address before: 0x7f61c6b5fc70
Detected that j uses these columns: c
.internal.selfref ptr is NULL. This is expected and normal for a data.table loaded from disk. If not, please report to data.table issue tracker.
Growing vector of column pointers from truelength 0 to 1025 . A shallow copy has been taken, see ?alloc.col. Only a potential issue if two variables point to the same data (we can't yet detect that well) and if not you can safely ignore this. To avoid this message you could alloc.col() first, deep copy first using copy(), wrap with suppressWarnings() or increase the 'datatable.alloccol' option.
.internal.selfref ptr is NULL. This is expected and normal for a data.table loaded from disk. If not, please report to data.table issue tracker.
Assigning to all 1000 rows
RHS_list_of_columns == false
df address after: 0x7f61cf6b5200
tt address after: 0x7f61c6b5fc70
[1] FALSE
A bit strange that ".internal.selfref ptr is NULL." is repeated
We could include advice to setDT after readRDS in this verbose message as well, as that would have helped:
Activity
jangorecki commentedon Jun 5, 2016
Are you aware of FAQ: 5.3 Reading
data.tablefrom RDS or RData file? I think it answers your question.vspinu commentedon Jun 5, 2016
Thanks, I was not aware of
alloc.col, but I don't see how that answers my question. The FAQ item states that the DT is re-allocated on next by reference operation with a warning. I don't see the warning.vspinu commentedon Jun 5, 2016
That FAQ item indeed explains why the copy happens and why I don't see the change outside of a function call. I guess this issue then boils down to the missing warning.
arunsrinivasan commentedon Jun 16, 2016
Seems like the warning message was removed a long time ago.. but it needs to be there.
MichaelChirico commentedon May 5, 2019
verbosehelps clear things up a bit:Has output:
setDTafterreadRDSin this verbose message as well, as that would have helped:has output
Closes #1729 -- more helpful messaging after readRDS() + assignment