
Just to add a couple of thoughts to the previous suggestions.

If you really want output from things like summary.lm to have tabs instead of spaces then you can type:
getAnywhere(print.summary.lm)

at the R prompt and it will show you the (not quite) source of code that R uses to do the printing to the console.  Copy this to your favorite text editor and use it to create a new function (tabbed.summary.lm?), go through and find the places where it prints output and change the spaces to tabs (in some cases the inserted space is a default and you will not see it directly).  You could even have the cat functions send the output directly to the clipboard rather than the screen.

I had one thought about using capture.output and gsub to replace series of spaces with tabs, but I think that would insert way to many tabs (but I have seen tabify functions elsware (emacs), perhaps that code could be rewritten in R to do what you want).


Others have suggested R2HTML and sweave, but I have not seen anyone else mention that R2HTML has an HTML driver for sweave.  This means that you can write a fairly minimal HTML file (you could even use MSword to set this up, but use a text editor for the later parts) and insert your R commands into the HTML file.  Run this through sweave using the HTML driver and the result is an HTML file (plus extra files for the graphics if any).  MSword can then read in the HTML file and either save it as a word doc or cut and paste from it into a word doc, or best of all, just put everything you need in the original template file and have this be your final product.

R2HTML can also capture an entire set of output into an HTML file (see HTMLStart and HTMLStop) that could then be read into MSword.

Hope this helps,






______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


	[[alternative HTML version deleted]]


