daff icon indicating copy to clipboard operation
daff copied to clipboard

data_diff objects fail on round trip to Rdata files

Open statisfactions opened this issue 6 years ago • 1 comments

I found the following behavior surprising:

library(daff)
example(diff_data)  # creates the "dd" patch

save(dd, file = "patch_loading.Rdata")
load("patch_loading.Rdata")

dd
## Error in context_eval(join(src), private$context) : 
##  Context has been disposed.

Almost all R objects can be safely written to Rdata or RDS files. Is this failure expected behavior?

If this is intended, I can contribute a documentation patch to diff_data and write_diff so people at least know to expect this -- it caught me off guard since R objects are usually self-contained and Rdata/RDS files are a big part of my workflow.

statisfactions avatar Sep 14 '17 21:09 statisfactions

Thanks for reporting! It should definitely be in the documentation: I will try to fix it, but I'm not sure if it is possible without some major work.

edwindj avatar Sep 22 '17 17:09 edwindj