

   hdf5 {base}                                  R Documentation

   IInntteerrffaaccee ttoo tthhee HHDDFF55 LLiibbrraarryy

   DDeessccrriippttiioonn::

        `hdf5save' and `hd5fload' provide an experimental
        interface to version 5 of the NCSA HDF library.

   UUssaaggee::

        hdf5save(file, ...)

        hdf5load(file, load = TRUE)

   AArrgguummeennttss::

       file: the name of the file in which the objects will be
             stored.

        ...: the names of the objects to be saved.

       load: a logical value.  If `FALSE', a character vector
             containing the names of the objects in the file is
             returned.  If `TRUE' (the default), the objects
             are returned as the components of a named list.

   DDeettaaiillss::

        `hdf5save' writes a representation of R objects to the
        specified file in a form which can be read by software
        which understands the HDF5 format.  The objects can be
        read back from the file at a later date by using the
        function `hdf5load'.

        Not all R types are supported and it probably doesn't
        make sense to put some of them into an HDF file (e.g.
        closures).  However, lists, strings, vectors, and
        matrices work.  Lists map to HDF groups.  Vectors and
        matrices map to datasets.

        This capability is only available on machines which
        have the HDF5 library, version 1.2 or higher (freely
        available from the reference below).

   AAuutthhoorr((ss))::

        Marcus G. Daniels mgd@santafe.edu.

   RReeffeerreenncceess::

        <URL: http://hdf.ncsa.uiuc.edu>

   SSeeee AAllssoo::

        `save', `load'.

   EExxaammpplleess::

        (m <- cbind(A = 1, diag(4)))
        ll <- list(a=1:10, b=letters[1:8]);
        l2 <- list(C="c", l=ll); PP <- pi
        hdf5save("ex1.hdf", m, PP, ll, l2)
        rm(m,PP,ll,l2) # and reload them:
        hdf5load("ex1.hdf")
        m        # read from "ex1.hdf"; buglet: dimnames dropped
        str(ll)  # buglet: "pairlist" instead of "list"
        str(l2)

