[R] Reading and writing to S-like databases

Prof Brian Ripley ripley at stats.ox.ac.uk
Fri Sep 28 16:11:31 CEST 2001


On Fri, 28 Sep 2001, Liaw, Andy wrote:

> [snipped...]
>
> > 3. As I point in the document "Getting your styff organized in R",
> > I've not found any way to list the objects within a binary R file,
> > nor to select particular objects from the binary file and attach
> > only the selected ones (which would be the best solution
> > in so many cases). I wonder if future R versions could consider
> > this feature.
>
> I'd like to express my strong second for similar feature.  I think it would
> be very helpful for project management.  Also would be nice is something
> similar to the Unix "ls -l": giving modes, length (or dim), etc. of the
> objects in some file or the workspace.

It's not as simple as that in R.  Objects are not self-contained: they
have an environment.  And objects can share parts.  The model you both
seem to have in mind isn't appropriate for R workspaces.

It's very easy to write a function giving modes, length (or dim), etc for
a workspace, which I'll leave as an exercise for the reader.  But it will
not be like ls -l: the size of an R object is not well-defined (see
?object.size) and neither is the data (because of sharing).

Take a look at the saveload.c source code, and when you follow what it
does you will be able to work out what is feasible.

-- 
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 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list