[R] export graph to Word/Excel

Mark Myatt mark at myatt.demon.co.uk
Thu Mar 15 12:01:42 CET 2001


Yu-Ling Wu <yuling5 at yahoo.com> writes:
>Hi,
>
>I have a set of script like this:
>
>----------------------
>summary(data)
>plot(time, users, type="o", xlab ="Time", ylab="Number
>of Users")
>----------------------
>
>I type "rterm --slave < script.r > output.doc" and the
>graphic doesn't
>actually in the output.doc file. How to make the
>graphic embedded in Word
>or Excel file?

I think you need to do to things:

        1. In R use win.metafile() or something similar to store the
        plot in a file ... MS Office can handle a variety of formats but
        some may need to be installed.

        2. Use a .VBA / .VBS script to automate Word / Excel to insert
        an object from a file.

You can probable use system() to spark the .VBA script from within R.

Mark

--
Mark Myatt


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list