Dear R-devel, Is there a way to find the size in bytes of a save() command --before-- the file has been saved? If not, can anyone point me to some resources on XDR so I can find a way to calculate it? Thanks, ====Nathan Whitehouse Statistics/Programming Baylor College of Medicine Houston, TX, USA nlwhitehouse@yahoo.com http://rho-project.org: rho- open source web services for R. http://franklin.imgen.bcm.tmc.edu: Shaw laboratory, bcm.
On Thu, 26 Feb 2004 08:21:05 -0800 (PST), Nathan Whitehouse <nlwhitehouse@yahoo.com> wrote :>Dear R-devel, > > Is there a way to find the size in bytes of a save() >command --before-- the file has been saved?I don't think so, though you can guess: integers are stored in 4 bytes, floats in 8, etc. One way to solve this problem would be to create a connection that did nothing except keep track of a file position, then do the save to that connection. However, it's not easy to define new connection types. Might be a nice package to write to allow such a thing. Duncan Murdoch
Nathan Whitehouse <nlwhitehouse@yahoo.com> writes:> Is there a way to find the size in bytes of a save() > command --before-- the file has been saved?You could try object.size(obj) which gives the size of the internal representation. The external representation should not be much larger. If you use compress = TRUE in the save call then the external representation may well be considerably smaller than the internal.