Export R generated tables and figures to MS Word

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

Export R generated tables and figures to MS Word

Santosh-14
Dear Rxperts,
I am aware of Sweave that generates reports into a pdf, but do know of any
tools to generate to export to a MS Word document...

Is there  a way to use R to generate and export report/publication quality
tables and figures and export them to MS word (for reporting purposes)?

Thanks so much,
Santosh

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Export R generated tables and figures to MS Word

nicoleford
probably not the answer you're looking for but i only use LaTeX.  




On Mar 12, 2013, at 8:02 PM, Santosh wrote:

> Dear Rxperts,
> I am aware of Sweave that generates reports into a pdf, but do know of any
> tools to generate to export to a MS Word document...
>
> Is there  a way to use R to generate and export report/publication quality
> tables and figures and export them to MS word (for reporting purposes)?
>
> Thanks so much,
> Santosh
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Export R generated tables and figures to MS Word

Jeff Newmiller
In reply to this post by Santosh-14
knitr markdown+pandoc gives serviceable results, for low enough expectations
---------------------------------------------------------------------------
Jeff Newmiller                        The     .....       .....  Go Live...
DCN:<[hidden email]>        Basics: ##.#.       ##.#.  Live Go...
                                      Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/Batteries            O.O#.       #.O#.  with
/Software/Embedded Controllers)               .OO#.       .OO#.  rocks...1k
---------------------------------------------------------------------------
Sent from my phone. Please excuse my brevity.

Santosh <[hidden email]> wrote:

>Dear Rxperts,
>I am aware of Sweave that generates reports into a pdf, but do know of
>any
>tools to generate to export to a MS Word document...
>
>Is there  a way to use R to generate and export report/publication
>quality
>tables and figures and export them to MS word (for reporting purposes)?
>
>Thanks so much,
>Santosh
>
> [[alternative HTML version deleted]]
>
>______________________________________________
>[hidden email] mailing list
>https://stat.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide
>http://www.R-project.org/posting-guide.html
>and provide commented, minimal, self-contained, reproducible code.

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Export R generated tables and figures to MS Word

Richard M. Heiberger
In reply to this post by Santosh-14
you are describing SWord, distributed at rcom.univie.ac.at

Sent from my iPhone

On Mar 12, 2013, at 20:02, Santosh <[hidden email]> wrote:

> Dear Rxperts,
> I am aware of Sweave that generates reports into a pdf, but do know of any
> tools to generate to export to a MS Word document...
>
> Is there  a way to use R to generate and export report/publication quality
> tables and figures and export them to MS word (for reporting purposes)?
>
> Thanks so much,
> Santosh
>
>    [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Export R generated tables and figures to MS Word

Robert Baer
In reply to this post by Santosh-14
R2wd (http://cran.r-project.org/web/packages/R2wd/R2wd.pdf 
<http://cran.r-project.org/web/packages/R2wd/R2wd.pdf>) might do what
you want.

Rob

On 3/12/2013 7:02 PM, Santosh wrote:

> Dear Rxperts,
> I am aware of Sweave that generates reports into a pdf, but do know of any
> tools to generate to export to a MS Word document...
>
> Is there  a way to use R to generate and export report/publication quality
> tables and figures and export them to MS word (for reporting purposes)?
>
> Thanks so much,
> Santosh
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.


--

Robert W. Baer, Ph.D.
Professor of Physiology
Kirksille College of Osteopathic Medicine
A. T. Still University of Health Sciences
Kirksville, MO 63501 USA


        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Export R generated tables and figures to MS Word

daroczig
In reply to this post by Jeff Newmiller
Just to second Jeff's answer about pandoc[1] with a minimal reproducible
example, you might give a try to my "pander" package [2] too:

> library(pander)
> Pandoc.brew(system.file('examples/minimal.brew', package='pander'),
output = tempfile(), convert = 'docx')

Where the content of the "minimal.brew" file is something you might have
got used to with Sweave - although it's using "brew" syntax instead. See
the examples of pander [3] for more details. Please note that pandoc should
be installed first, which is pretty easy on Windows.

Best,
Gergely

  [1] http://johnmacfarlane.net/pandoc/
  [2] http://rapporter.github.com/pander/
  [3] http://rapporter.github.com/pander/#examples

On 13 March 2013 03:28, Jeff Newmiller <[hidden email]> wrote:

> knitr markdown+pandoc gives serviceable results, for low enough
> expectations
> ---------------------------------------------------------------------------
> Jeff Newmiller                        The     .....       .....  Go Live...
> DCN:<[hidden email]>        Basics: ##.#.       ##.#.  Live
> Go...
>                                       Live:   OO#.. Dead: OO#..  Playing
> Research Engineer (Solar/Batteries            O.O#.       #.O#.  with
> /Software/Embedded Controllers)               .OO#.       .OO#.  rocks...1k
> ---------------------------------------------------------------------------
> Sent from my phone. Please excuse my brevity.
>
> Santosh <[hidden email]> wrote:
>
> >Dear Rxperts,
> >I am aware of Sweave that generates reports into a pdf, but do know of
> >any
> >tools to generate to export to a MS Word document...
> >
> >Is there  a way to use R to generate and export report/publication
> >quality
> >tables and figures and export them to MS word (for reporting purposes)?
> >
> >Thanks so much,
> >Santosh
> >
> >       [[alternative HTML version deleted]]
> >
> >______________________________________________
> >[hidden email] mailing list
> >https://stat.ethz.ch/mailman/listinfo/r-help
> >PLEASE do read the posting guide
> >http://www.R-project.org/posting-guide.html
> >and provide commented, minimal, self-contained, reproducible code.
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Export R generated tables and figures to MS Word

Frank Harrell
In reply to this post by Robert Baer
The best rendering of advanced tables is done by converting from pdf to Word.  See http://biostat.mc.vanderbilt.edu/SweaveConvert

Frank
Robert Baer wrote
R2wd (http://cran.r-project.org/web/packages/R2wd/R2wd.pdf 
<http://cran.r-project.org/web/packages/R2wd/R2wd.pdf>) might do what
you want.

Rob

On 3/12/2013 7:02 PM, Santosh wrote:
> Dear Rxperts,
> I am aware of Sweave that generates reports into a pdf, but do know of any
> tools to generate to export to a MS Word document...
>
> Is there  a way to use R to generate and export report/publication quality
> tables and figures and export them to MS word (for reporting purposes)?
>
> Thanks so much,
> Santosh
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.


--

Robert W. Baer, Ph.D.
Professor of Physiology
Kirksille College of Osteopathic Medicine
A. T. Still University of Health Sciences
Kirksville, MO 63501 USA


        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Frank Harrell
Department of Biostatistics, Vanderbilt University
Reply | Threaded
Open this post in threaded view
|

Re: Export R generated tables and figures to MS Word

Liviu Andronic
In reply to this post by Santosh-14
On Wed, Mar 13, 2013 at 1:02 AM, Santosh <[hidden email]> wrote:
> Dear Rxperts,
> I am aware of Sweave that generates reports into a pdf, but do know of any
> tools to generate to export to a MS Word document...
>
> Is there  a way to use R to generate and export report/publication quality
> tables and figures and export them to MS word (for reporting purposes)?
>
Instead of pure LaTeX, you may use LyX to generate Sweave/knitr reports.

Liviu


> Thanks so much,
> Santosh
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



--
Do you know how to read?
http://www.alienetworks.com/srtest.cfm
http://goodies.xfce.org/projects/applications/xfce4-dict#speed-reader
Do you know how to write?
http://garbl.home.comcast.net/~garbl/stylemanual/e.htm#e-mail

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Export R generated tables and figures to MS Word

Bart Joosen
This post has NOT been accepted by the mailing list yet.
In reply to this post by Santosh-14
I'm using R2wd for this purpose.

Reply | Threaded
Open this post in threaded view
|

Re: Export R generated tables and figures to MS Word

MacQueen, Don
In reply to this post by Santosh-14
There's the package
  rtf Rich Text Format (RTF) Output

I've not tried it, but the name is suggestive.

--
Don MacQueen

Lawrence Livermore National Laboratory
7000 East Ave., L-627
Livermore, CA 94550
925-423-1062





On 3/12/13 5:02 PM, "Santosh" <[hidden email]> wrote:

>Dear Rxperts,
>I am aware of Sweave that generates reports into a pdf, but do know of any
>tools to generate to export to a MS Word document...
>
>Is there  a way to use R to generate and export report/publication quality
>tables and figures and export them to MS word (for reporting purposes)?
>
>Thanks so much,
>Santosh
>
> [[alternative HTML version deleted]]
>
>______________________________________________
>[hidden email] mailing list
>https://stat.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide
>http://www.R-project.org/posting-guide.html
>and provide commented, minimal, self-contained, reproducible code.

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Export R generated tables and figures to MS Word

David Carlson
Package xtable will produce html output. If you save the file and then open
it with Word, you will get serviceable results. I've had better luck copying
the output from xtable and pasting it into Excel. Make necessary changes and
then paste the table into Word. Obviously very tedious if you are making
more than a few tables. There is also an R2wd package, but I haven't tried
it.

----------------------------------------------
David L Carlson
Associate Professor of Anthropology
Texas A&M University
College Station, TX 77843-4352


> -----Original Message-----
> From: [hidden email] [mailto:r-help-bounces@r-
> project.org] On Behalf Of MacQueen, Don
> Sent: Wednesday, March 13, 2013 11:56 AM
> To: Santosh; r-help
> Subject: Re: [R] Export R generated tables and figures to MS Word
>
> There's the package
>   rtf Rich Text Format (RTF) Output
>
> I've not tried it, but the name is suggestive.
>
> --
> Don MacQueen
>
> Lawrence Livermore National Laboratory
> 7000 East Ave., L-627
> Livermore, CA 94550
> 925-423-1062
>
>
>
>
>
> On 3/12/13 5:02 PM, "Santosh" <[hidden email]> wrote:
>
> >Dear Rxperts,
> >I am aware of Sweave that generates reports into a pdf, but do know of
> any
> >tools to generate to export to a MS Word document...
> >
> >Is there  a way to use R to generate and export report/publication
> quality
> >tables and figures and export them to MS word (for reporting
> purposes)?
> >
> >Thanks so much,
> >Santosh
> >
> > [[alternative HTML version deleted]]
> >
> >______________________________________________
> >[hidden email] mailing list
> >https://stat.ethz.ch/mailman/listinfo/r-help
> >PLEASE do read the posting guide
> >http://www.R-project.org/posting-guide.html
> >and provide commented, minimal, self-contained, reproducible code.
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-
> guide.html
> and provide commented, minimal, self-contained, reproducible code.

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Export R generated tables and figures to MS Word

Santosh-14
Dear Rxperts..
Awesome responses! Thank you so much for your responses! I think I have a
50-course meal to gobble! If you get more ideas.. Please do continue to
share.

Santosh


On Wed, Mar 13, 2013 at 10:13 AM, David L Carlson <[hidden email]> wrote:

> Package xtable will produce html output. If you save the file and then open
> it with Word, you will get serviceable results. I've had better luck
> copying
> the output from xtable and pasting it into Excel. Make necessary changes
> and
> then paste the table into Word. Obviously very tedious if you are making
> more than a few tables. There is also an R2wd package, but I haven't tried
> it.
>
> ----------------------------------------------
> David L Carlson
> Associate Professor of Anthropology
> Texas A&M University
> College Station, TX 77843-4352
>
>
> > -----Original Message-----
> > From: [hidden email] [mailto:r-help-bounces@r-
> > project.org] On Behalf Of MacQueen, Don
> > Sent: Wednesday, March 13, 2013 11:56 AM
> > To: Santosh; r-help
> > Subject: Re: [R] Export R generated tables and figures to MS Word
> >
> > There's the package
> >   rtf Rich Text Format (RTF) Output
> >
> > I've not tried it, but the name is suggestive.
> >
> > --
> > Don MacQueen
> >
> > Lawrence Livermore National Laboratory
> > 7000 East Ave., L-627
> > Livermore, CA 94550
> > 925-423-1062
> >
> >
> >
> >
> >
> > On 3/12/13 5:02 PM, "Santosh" <[hidden email]> wrote:
> >
> > >Dear Rxperts,
> > >I am aware of Sweave that generates reports into a pdf, but do know of
> > any
> > >tools to generate to export to a MS Word document...
> > >
> > >Is there  a way to use R to generate and export report/publication
> > quality
> > >tables and figures and export them to MS word (for reporting
> > purposes)?
> > >
> > >Thanks so much,
> > >Santosh
> > >
> > >     [[alternative HTML version deleted]]
> > >
> > >______________________________________________
> > >[hidden email] mailing list
> > >https://stat.ethz.ch/mailman/listinfo/r-help
> > >PLEASE do read the posting guide
> > >http://www.R-project.org/posting-guide.html
> > >and provide commented, minimal, self-contained, reproducible code.
> >
> > ______________________________________________
> > [hidden email] mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide http://www.R-project.org/posting-
> > guide.html
> > and provide commented, minimal, self-contained, reproducible code.
>
>

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Export R generated tables and figures to MS Word

glsnow
I don't see any mention of odfWeave yet.  It works with OpenOffice files.
 OpenOffice is a free equivalent to MS Office and can read and write Word
documents.  So you can create your template file in OpenOffice (or use MS
word and convert to OpenOffice format, OO will read word docs, and recent
versions of Word will write OpenOffice docs), process it with R and
odfWeave, then convert the result to Word (or open it with recent versions
of Word that read odf files).

Note that Sword and R2wd have a part of their toolchain that is not free
software, so if you use either check to make sure that you have filled the
license conditions.

These days I personally use eithre the pander package or knitr (usually
with Markdown, sometimes LaTeX) and use pandoc to convert to Word format.
 Most of my tables are simple enough that this works great, with something
more complicated I would follow Frank's advice and first create a pdf from
LaTeX, then convert from there if needed.


On Wed, Mar 13, 2013 at 12:20 PM, Santosh <[hidden email]> wrote:

> Dear Rxperts..
> Awesome responses! Thank you so much for your responses! I think I have a
> 50-course meal to gobble! If you get more ideas.. Please do continue to
> share.
>
> Santosh
>
>
> On Wed, Mar 13, 2013 at 10:13 AM, David L Carlson <[hidden email]>
> wrote:
>
> > Package xtable will produce html output. If you save the file and then
> open
> > it with Word, you will get serviceable results. I've had better luck
> > copying
> > the output from xtable and pasting it into Excel. Make necessary changes
> > and
> > then paste the table into Word. Obviously very tedious if you are making
> > more than a few tables. There is also an R2wd package, but I haven't
> tried
> > it.
> >
> > ----------------------------------------------
> > David L Carlson
> > Associate Professor of Anthropology
> > Texas A&M University
> > College Station, TX 77843-4352
> >
> >
> > > -----Original Message-----
> > > From: [hidden email] [mailto:r-help-bounces@r-
> > > project.org] On Behalf Of MacQueen, Don
> > > Sent: Wednesday, March 13, 2013 11:56 AM
> > > To: Santosh; r-help
> > > Subject: Re: [R] Export R generated tables and figures to MS Word
> > >
> > > There's the package
> > >   rtf Rich Text Format (RTF) Output
> > >
> > > I've not tried it, but the name is suggestive.
> > >
> > > --
> > > Don MacQueen
> > >
> > > Lawrence Livermore National Laboratory
> > > 7000 East Ave., L-627
> > > Livermore, CA 94550
> > > 925-423-1062
> > >
> > >
> > >
> > >
> > >
> > > On 3/12/13 5:02 PM, "Santosh" <[hidden email]> wrote:
> > >
> > > >Dear Rxperts,
> > > >I am aware of Sweave that generates reports into a pdf, but do know of
> > > any
> > > >tools to generate to export to a MS Word document...
> > > >
> > > >Is there  a way to use R to generate and export report/publication
> > > quality
> > > >tables and figures and export them to MS word (for reporting
> > > purposes)?
> > > >
> > > >Thanks so much,
> > > >Santosh
> > > >
> > > >     [[alternative HTML version deleted]]
> > > >
> > > >______________________________________________
> > > >[hidden email] mailing list
> > > >https://stat.ethz.ch/mailman/listinfo/r-help
> > > >PLEASE do read the posting guide
> > > >http://www.R-project.org/posting-guide.html
> > > >and provide commented, minimal, self-contained, reproducible code.
> > >
> > > ______________________________________________
> > > [hidden email] mailing list
> > > https://stat.ethz.ch/mailman/listinfo/r-help
> > > PLEASE do read the posting guide http://www.R-project.org/posting-
> > > guide.html
> > > and provide commented, minimal, self-contained, reproducible code.
> >
> >
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



--
Gregory (Greg) L. Snow Ph.D.
[hidden email]

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.