[R] Hand-crafting an .RData file

Adam D. I. Kramer adik at ilovebacon.org
Mon Nov 9 06:27:34 CET 2009


Hello,

 	I frequently have to export a large quantity of data from some
source (for example, a database, or a hand-written perl script) and then
read it into R.  This occasionally takes a lot of time; I'm usually using
read.table("filename",comment.char="",quote="") to read the data once it is
written to disk.

 	However, I *know* that the program that generates the data is more
or less just calling printf in a for loop to create the csv or tab-delimited
file, writing, then having R parse it, which is pretty inefficient. 
Instead, I am interested in figuring out how to write the data in .RData
format so that I can load() it instead of read.table() it.

 	Trolling the internet, however, has not suggested anything about the
specification for an .RData file. Could somebody link me to a specification
or some information that would instruct me on how to construct a .RData
file (either compressed or uncompressed)?

 	Also, I am open to other suggestions of how to get load()-like
efficiency in some other way.

Many thanks,
Adam D. I. Kramer




More information about the R-help mailing list