[R] How do people use Sweave / R / Databases

Duncan Murdoch murdoch at stats.uwo.ca
Fri Jan 29 20:45:13 CET 2010


On 29/01/2010 2:28 PM, Paul wrote:
> I'm currently using r scripts in sweave to grab some data via ODBC, 
> process it then generate some tables.  I'd like to be able to give 
> someone the files and let them reproduce what I've done.  Is there some 
> way to store the data that is gathered by ODBC so that the second person 
> can recreate the work without the database (apart from just writing it 
> to a file or into the document)


What I've done in a case like that is to store the data in a .Rdata file 
using save(), then have the Sweave code call load() to load it at the 
beginning of the script.
There's also the cacheSweave package (and I think another one whose name 
I can't remember) to cache the value of some code blocks; you might be 
able to bundle up the document with the cache to send to someone who 
doesn't want to re-run the retrieval code.

Duncan Murdoch



More information about the R-help mailing list