R - readRDS() & load() fail to give identical data.tables as the original

后端 未结 4 2131
野趣味
野趣味 2021-02-13 13:44

Background

I tried to replace some CSV output files with rds files to improve efficiency. These are intermediate files that wi

4条回答
  •  灰色年华
    2021-02-13 14:30

    The newly loaded data.table doesn't know the pointer value of the already loaded one. You could tell it with

    attributes(bDT)$.internal.selfref <- attributes(aDT)$.internal.selfref
    identical( aDT, bDT, ignore.environment = T )
    # [1] TRUE
    

    data.frame don't keep this attribute, probably because they don't do in place modification.

提交回复
热议问题