Skip to content

Save the results of data analysis in R

3 messages · amrita gs, Jim Lemon, Paul Hiemstra

#
On 06/16/2011 07:12 PM, amrita gs wrote:
Hi amrita,
If you mean "save the output of an analysis", there are several ways.

1) Enter "sink(<filename>) before running the analysis, and "sink()" 
after. This will store the results of whatever you did between the two 
"sink" commands in the file <filename> (which is the name you choose to 
call it).

2) Write your analysis as a script and use a function like "htmlize" to 
convert the output to HTML and store it. This allows you to get most 
bitmapped plots embedded in the output, which is what many people want.

For both of the above, you will want to write and test the R script 
until it runs correctly, then use "sink" or "htmlize" (or other 
functions from, say, the R2HTML package) to do the conversion. There are 
similar functions that will convert the output to document formats like 
Latex if you want.

Jim
#
On 06/16/2011 09:23 AM, Jim Lemon wrote:
...and if you mean "save the R objects" you need to look at save().

cheers,
Paul