[R] What is the best way to have "R" output tables in an MS Word format?

Gabor Grothendieck ggrothendieck at gmail.com
Sat May 1 17:04:49 CEST 2010


On Sat, May 1, 2010 at 3:41 AM, Chris Evans <chrishold at psyctc.org> wrote:
> It's interesting to see this coming up quite soon after my posting
> asking for light formatting (tabs, simple tables, one day embedded
> graphics) in a default output pane in R.
>
> Greg Snow kindly pointed me to sword and I've tried it and it seems to
> work and is a bit friendlier than ODFweave or the xtable, hwriter and
> R2HTML options that I also know.  Sweave and the whole transition to
> TeX/LaTeX, though I'd love it, just isn't a realistic option for me as
> my statistical/numerical work is done in a world in which pretty
> literally no-one uses TeX and I and many others who are part time with R
> will never have time to learn to go that way.  (I promise myself I'll
> give it one determined try when I retire but even then all papers I
> submit to journals will have to be in Word or RTF.)
>
> Greg also kindly pointed me to the R-Plus GUI by Xlsolutions corp
> (http://www.youtube.com/watch?v=1qsv1MdB4tk) (thanks Greg) and that
> clearly has some of the formatted table output I'd like but it is also a
> huge shift towards the whole SPSS style pull down menus for everything
> and I really don't want that (and can't justify the price!)
>
> Come on R core team: I am sure there are a large number of users like
> Max Gunther and myself who would find this a huge help and I'm equally
> sure there are an even larger number of potential users who would change
> to R if we had formatted tables in the output window and the option to
> save that to HTML, TeX, ODF and ideally RTF.  I think three quarters of
> the export/save primitives needed are there in these various add ons to
> R that alread exist and all that's needed on top of them is a simple
> screen rendering that would handle tables.  (Graphics later or even
> never would be fine by me.)
>
> Yours in hope and huge appreciation for what we already have which I
> have been using a bit this last week and, as ever, marvelling at its
> power and simplicity ... and I didn't need tables from it for once!
>

Regarding RTF, note that the Microsoft document that defines RTF was
actually the subject of a dispute with competitors of Microsoft who
claimed that it is so vague that it effectively imposes too high a
barrier for others to climb  to realistically interface to Word via
RTF.  One can only do it by supplementing the spec with substantial
trial and error so its not so straight forward to develop RTF
software.

Having written such software for my commercial R package, RTFgen,
which generates RTF from R I am quite aware of the problems.
Since other commercial packages are being mentioned here I will add
some info on this one too.  The package is similar in concept to the
hwriter and R2HTML packages on CRAN except that instead of generating
HTML like those packages do it generates RTF that is directly readable
by Word.  Its single pass, i.e. it generates RTF directly so there is
no intermediate document that might otherwise need to debugged during
the development of a report. It is written in 100% R and requires no
non-R software, not even Word, to generate reports making it trivial
to deploy.



More information about the R-help mailing list