4

I'm producing plenty of analyses in R and utilizing the .html Markdown format to present and communicate work. Often, my manager will need to correct/add to the text which accompanies the code blocks, and has practically no interaction with the code blocks. The analyses are typically produced by myself alone, so code collaboration is a low priority.

In an ideal world, he could open up the .html and edit the text in a browser, which I understand is not possible.

Are there any simple solutions for this? I am sure this is a common problem so there must be an easy solution I am overlooking. Here are the current solutions being considered:

  1. Use Git (but my manager wouldn't like to learn Git)
  2. Use Jupyter Notebooks (but I would prefer to stick with R Markdown for integration with RStudio and for the reproducible templates)
  3. Knit the Markdown as a word document with manual version control on a shared network, allow tracking of changes in the word document, and copy-and-paste over changes made to the .Rmd file

The latter is least elegant but most likely to be used at the moment. If you have any suggestions, please let me know!

  • 1
    Maybe `redoc` is an option for you. Haven't tried it myself and it's still experimental but it would allow you to collaborate via Word. Basically the Word document can be edited and passed back to RMarkdown with all changes. See https://github.com/noamross/redoc – stefan Mar 25 '20 at 19:07
  • I haven't tried it yet, but this looks like a promising solution. I'm a bit surprised there's no obvious go-to's since I thought this problem could crop up a lot in several different industries. I'll look into this though, thank you! – M. Capewell Mar 26 '20 at 10:30
  • Feel free to give your comment as an answer - I've since used it and I'm pleased it's a workable solution – M. Capewell Apr 14 '20 at 16:02
  • Not sure whether my comment deserves the honor of being marked as an answer. However marking it as an answer may provide others a guide to a possible solution. So. Thank you. Also for checking `redoc` out. Good to know that it's worth a try. – stefan Apr 14 '20 at 19:04
  • related: https://stackoverflow.com/questions/45817937/rmarkdown-generated-html-document-notes-comments-pane and https://academia.stackexchange.com/questions/164476/reviews-feedback-and-comments-from-collaborators-supervisors-when-writing-in-rm – user63230 Mar 11 '23 at 17:46

3 Answers3

2

Here's a solution that is tailor-made your exact situation.

Use jupytext for bi-directional lossless interoperability between jupyter notebooks and R Markdown documents!

1

Maybe redoc is an option for you. Haven't tried it myself and it's still experimental but it would allow you to collaborate via Word. Basically the Word document can be edited and passed back to RMarkdown with all changes. See here.

stefan
  • 90,330
  • 6
  • 25
  • 51
1

I suggest you try trackdown https://claudiozandonella.github.io/trackdown/

trackdown offers a simple answer to collaborative writing and editing of R Markdown (or Sweave) documents. Using trackdown, the local .Rmd (or .Rnw) file is uploaded as plain-text in Google Drive where, thanks to the easily readable Markdown (or LaTeX) syntax and the well-known online interface offered by Google Docs, collaborators can easily contribute to the writing and editing of the narrative part of the document. After integrating all authors’ contributions, the final document can be downloaded and rendered locally.

Moreover, you can hide code chunks setting hide_code = TRUE (they will be automatically restored when downloaded). This prevents collaborators from inadvertently making changes to the code that might corrupt the file and it allows collaborators to focus only on the narrative text ignoring code jargon.

You can also upload the actual Output (i.e., the resulting complied document) in Google Drive together with the .Rmd (or .Rnw) document. This helps collaborators to evaluate the overall layout, figures and tables and it allows them to use comments on the pdf to propose and discuss suggestions.