1

I am getting started with the reproducible research tools in R, and I'm pretty excited about the prospects. Sweave/Knitr/Markdown, all that stuff is great. I use RStudio, and they have done a great job of integrating those tool, and I hear that StatET does a nice job putting all that together as well.

I don't write academic papers in LaTeX, and all the people I work with use Word, so I am very interested in an effective workflow to use ODFWeave to make documents.

My usual process is:

  1. Develop the code chunks in my IDE (RStudio, in my case)
  2. Go back and insert these into a ODT document and fill in the surrounding text.
  3. run ODFweave

My problem is that I get confused in tracking code chunks and putting them into the ODF document. Keeping the ODF document in sync as I create the code is annoying, so I'd rather wait and insert the code chunks by name.

So finally, here are my questions:

  • What are people's suggestions for tracking code chunks or on how to optimize this workflow?
  • Can anyone recommend tools or tips for keeping track of the code chunks you write?

Being a software geek and a data nerd, I naturally imagine a piece of software doing this for me. Like I'd have a database of code chunks, and when writing the ODF document I'd be able to click on a chunk to insert it into my ODF file.

  • Has one anyone created this sort of thing?
Eric E
  • 191
  • 1
  • 3
  • Not odfweave, but anyway, knitr has an externalisation feature that I use extensively, that allows you to have all your chunks in a separate R file, and only refer to them by name in the knitr document. – baptiste May 24 '13 at 14:10

1 Answers1

3

When you check the number of items tagged odfweave on SO, you will notice that it is rarely used compared to Sweave and knit-offs. I do not fully understand why it did not take off, possible because of table-generation being such a nuisance (at least that what I remember from my attempts).

Since many customers insist on Word-Documents, we are using two alternatives currently:

  • Create html, e.g. with RStudio/knitr/rmd, and read it with Word. This is not really a good workflow, to get reasonable document you need much manual post-processing, but it works more or less.
  • You can also use the path via RDCOM. I don't remember what's the state of art here, because we have totally given up using it since the conditions of licensing were not transparent to us.
  • Use pandoc. This approach produces documents that do not need manual post-processing in MS-Word, but the range of features to create a nice layout (cross-linked images, figure numbering) are limited; it might be a problem that we are not yet good enough in using pandoc in its full.
Dieter Menne
  • 10,076
  • 44
  • 67
  • 1
    +10 for pandoc. I recently switched from R+latex to R+markdown, and it's absurdly easy to produce any output format that you might want; the conversion is mostly flawless, and it doesn't tie you down to the idiosyncrasies of any particular output format -- you just write text, as you would in an email. No weird formatting tags, no dangerous software ties. Granted there are a few limitations in the formatting and links, but you can always polish the final output when down to the final version of a report. – baptiste May 24 '13 at 14:07
  • Thanks, I will check out pandoc. Do you all still edit the text part of your Sweave/odfWeave/markdown in your IDE (R Studio in my case)? I kind of like the WYSIWYG aspect of writing the text in Writer. – Eric E May 27 '13 at 21:26
  • 1
    Yes, no way around that. Something like a two-way editor, were changes in Writer port back to IDE is unlikely to be realized at the moment. LyX comes closest, and Yihui (knitr) like(s)(d) it a lot. – Dieter Menne May 28 '13 at 05:17