From ripley at stats.ox.ac.uk  Tue Mar  3 08:27:37 2009
From: ripley at stats.ox.ac.uk (Prof Brian Ripley)
Date: Tue, 3 Mar 2009 07:27:37 +0000 (GMT)
Subject: [Rd] S4 data dump or?
In-Reply-To: <49AC56E8.50502@bank-banque-canada.ca>
References: <49AC56E8.50502@bank-banque-canada.ca>
Message-ID: <alpine.OSX.1.00.0903030714540.53034@tystie.local>

On Mon, 2 Mar 2009, Paul Gilbert wrote:

> I am trying to dump some data in a file that I will add to a package.  The 
> data has an attribute which is a S4 object, and this seems to cause problems. 
> What is the preferred way to write a file with a dataset that has some S4 
> parts, so that it can be included in a package?

Using save() seems almost always preferable to dump(): usually a 
smaller result, avoids representation error changes for numeric types 
and encoding issues for some character vectors, works for almost all 
objects.

I am guessing that the note on ?dump about objects of type S4 is the 
issue here.

> Paul Gilbert

-- 
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



[Rd] S4 data dump or?
Prof Brian Ripley