[R] Redefining reference class makes persistent object partly unreadable

Jeff Newmiller jdnewmil at dcn.davis.CA.us
Sat Jul 26 19:06:41 CEST 2014


This doesn't surprise me, but then I am not a fan of reference classes.

The obvious (to me) answer is to read the objects with the old code and convert them to the new format on the fly or save the data in a more neutral format like csv or json for later use.
---------------------------------------------------------------------------
Jeff Newmiller                        The     .....       .....  Go Live...
DCN:<jdnewmil at dcn.davis.ca.us>        Basics: ##.#.       ##.#.  Live Go...
                                      Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/Batteries            O.O#.       #.O#.  with
/Software/Embedded Controllers)               .OO#.       .OO#.  rocks...1k
--------------------------------------------------------------------------- 
Sent from my phone. Please excuse my brevity.

On July 25, 2014 5:11:17 PM PDT, Ross Boylan <ross at biostat.ucsf.edu> wrote:
>A bunch of .rdata is on the disk, created from reference classes (as in
>setRefClass()).  I redefined some of the classes--not by much.  Now
>when
>I read in the rdata it seems to have been damaged, because some parts
>have "disappeared".  The data are generally a graph of objects, some of
>which (e.g., lists) are conventional rather than reference classes.
>
>The specific  part that I noticed disappearing was actually a list
>element.
>
>The redefinition seemed quite minimal: no slots changed and the number
>of methods did not change.  In some cases the name changed (from show
>to
>summary) along with the definition, in other cases just the definition
>of the function changed.
>
>I've verified the crucial role of the code change by flipping between
>different versions of the code.  R 3.0.3 on Debian GNU/Linux.
>
>Context: I implemented a bunch of show reference class methods to
>display my results.  Now I want to display them in other forms, and so
>am trying to shift to returning a summary object.
>
>Thanks.
>Ross Boylan
>
>______________________________________________
>R-help at r-project.org mailing list
>https://stat.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide
>http://www.R-project.org/posting-guide.html
>and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list