Skip to content
Prev 751 / 15274 Next

Saving a matrix in binary format

On 5 April 2006 at 11:16, Indrajit Chatterjee wrote:
| Hi - is it possible to save and load a matrix in binary form using R?
| 
|  
| 
| For example save.matrix() - and load.matrix() , but where the saves and
| loads are in binary format for speed and compactness. 

See  help(save)   -- it is even better than what you ask for as it works for
every R data type, allows for compression and is portable across portable
thanks to the underlying xdr binary representation.  It is the same format R
uses when it saves an interactive session.

Hope this helps, Dirk