[R] weirdness in sourc()ing a dump() (bug?)

Prof Brian Ripley ripley at stats.ox.ac.uk
Wed May 5 21:50:29 CEST 2004


On Wed, 5 May 2004, Duncan Murdoch wrote:

> On Wed, 5 May 2004 20:20:51 +0100 (BST), Prof Brian Ripley
> <ripley at stats.ox.ac.uk> wrote :
> 
> >I don't think it is a bug.  Note that dump does not even claim to dump
> >lists let alone symbols, but ?dump says
> >
> >     At present the implementation of 'dump' is very incomplete and it
> >     really only works for functions and simple vectors.
> >
> >Given that, this is not unexpected. (Looks like more than one person did 
> >not check the help page ....)
> >
> >I think save/load is a much safer way to handle saving R objects, and it 
> >does work in PD's example.
> 
> I'd still call it a bug, since 'dump("x"); source("dumpdata.R")' could
> change the meaning of x without any warning, and that can't be
> desirable behaviour.  

That's not what it says it does, and not what the S version achieves 
either.  (Do see the documentation on `what is a bug' in the FAQ, which 
does not agree with you.)

I was trying to be constructive: save/load *is* supposed to reproduce
objects, and it just not realistic to get dump/source to do that.  And we
do warn about it in the documentation and I can see nowhere that
recommends dump/save as a way of saving objects ....  (If there is such a 
place, then that is a bug and needs fixing.)

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595




More information about the R-help mailing list