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

Duncan Murdoch murdoch.duncan at gmail.com
Fri May 7 12:24:03 CEST 2010

chrishold at psyctc.org wrote:
> I've changed the subject line a bit here as Max is asking such a
> fundamental question.
> Max Kuhn sent the following  at 01/05/2010 19:22:
>> Chris,
> ...
>> Why is it R Core's job to fulfill your wants and desires? I have a
>> hard time thinking that very busy people would spend extra time doing
>> something that they may or may not have a direct need for. Write it
>> yourself or get a group of people together to do it. That what we did
>> with odfWeave (for better or worse). If the task is beyond what you
>> feel you can do, fund it.
> Ouch.  OK. I'm hugely grateful for your work on odfWeave Max and sorry
> that Open Office isn't a solution for me at the moment.  However, I
> don't think I'm being unreasonable or selfish.
> 1) Certainbly it's not R core's job to fulfil my wants and desires and
> they will have ways to discuss what would strengthen R for lots of us.
> Clearly I can submit a wishlist item to the R bugzilla and I should but
> that's very particulate: how can the team find out of wishes are common
> or would help increase use of R?
> There are files of key R core team members' wish lists on the R site but
> almost none relate in any way to output and some appear to be years old.
> I've worked with R (about 14 years I think) and as I look particularly
> at the recent release notes, I see a lot of work went into changing the
> help system which is one sort of output from R and a huge amount of work
> went into transitions in the object orientation (S3 to S4).  I think
> that what I am suggesting is about a core issue of seeing
> a set of object properties for numeric output as including insertion of
> tabs, ideally as providing flexible presenting and viewing of all
> matrices, data frames and lists, and, some day, cross linkage of
> graphics into output.  Ideally, as with the capacity of R to export its
> graphics in a number of formats, I'd love to see this capitalising on
> the work you have done for ODF and others have done for TeX etc.
> These strike me as central object handling issues, not things that
> should for ever be offloaded to the libraries/packages.

I don't think that because something is important it needs to be in the 
part of R that R Core handles.  The things that need to be there are 
things that can't be anywhere else.  Things that can be elsewhere should 
be elsewhere, because the more that is in base R, the more time R Core 
spends on maintenance, and the less time on development of base R or on 
the other things we do (e.g. the things our employers pay us to do).

We don't always follow this rule:  in some cases, things that could be 
elsewhere are in base R because an R Core member doesn't mind taking on 
the maintenance, and it is easier to put them in base R than to create a 
new package for them.  (Sweave is an example of this; there has been 
talk of moving it out of the base, but that hasn't happened yet.)

But I don't think any members of R Core use any of those word processors 
called MS Word, and I don't see any need for core support for producing 
output for them.  R already produces structured objects with all the 
semantics of XML objects (though it doesn't use that format to store 
them); it is simply a matter of deciding what format you'd like things 
to be displayed in, and then figuring out how to produce something in 
that format in a way that MS Word will understand.  The first task is 
definitely something within the range of an R user.  Getting it into 
some version of .doc or .docx or whatever  is not at all easy, but it 
really has very little to do with R.  It would make more sense to ask 
Microsoft to handle that part than it makes to ask R Core to do it.

Duncan Murdoch

2) Do it myself: I wish! I'm a terrible programmer and work 50-70 hoursa 
week in my main jobs (I'm so outspoken here at the moment partly
> because I'm off work post-op.)  I'm quite a good psychotherapist and
> capable of working in several different modes of psychotherapy and with
> individuals, couples, groups and families and I'm a fairly competent
> researcher and clinical director.  I wish I'd been born or learned to be
> a better programmer as I wish I'd been more musical and able to dance
> but I'm not.  I can contribute ideas, help debug things and hope to
> contribute much more of this when I retire from the main jobs.  I have
> no links with programmers at work nor in my university location so I
> have no colleagues with whom I can form a team to do this.
> 3) Pay for it myself: I was pretty ignorant about ways of paying for
> R things.  I can't see me persuading my NHS employer to pay as we're
> contracting rapidly and don't officially use R.  If we had the
> outputting I'm describing in the R core I think I might be able to get
> us to stop paying some thousands of pounds a year for SPSS and might be
> able to shift say 1k in gratitude to R though NHS purchasing rules don't
> make that easy.  (That, I think, is one of the huge challenges to open
> source s'ware, if someone can tell me about ways to get organisations
> who have to justify their purchasing as we do manage to pay for open
> source development, I'd like to hear and I'll try to make it happen.)
> Prompted by your Email I have found the R project membership form and
> 'faxed it off with payment and will probably donate some more on top of
> that 25 euros.  However, I would love a way to make a donation
> that would encourage someone to do this bit of work but I'm currently
> unlikely, personally, to have the money to pay for all that's needed.
> Hope this helps explain my position.  I'm genuinely keen to hear others'
> views.  Very best to all,
> Chris

More information about the R-help mailing list