Does anyone have tips for good workflows between R and Google Docs? I do almost all my analysis in R and prepare my reports using RMarkdown. For almost everyone at my company, however, Google Docs documents & slides are the best way to share documents and receive comments. Currently, I'm exporting my RMarkdown documents by knitting into Word docs and importing into Google Docs. This is pretty clunky and has some formatting issues. Anyone have a better way?
Interesting question! I look forward to hearing some answers. I have done part of that - collaborating on a google doc and making figures in R. I used package googleDrive to upload png files, and then linked to those images in the google doc. When I rerun the scripts and update the image files on my google drive the images update in the doc.
Maybe pandoc can do md -> google doc?
One way I want to explore is: knit the .Rmd to .md using the
imgur_upload() function (like reprex uses), then pandoc the output .md to .html. This would preserve the images and hopefully not introduce too many formatting issues.
This is a cool approach. It sounds quite automatable!
this package looks very cool! I'm going to try it out! What problems does it have currently?
@billR The main problem is like the one you highlight.
Markdrive works well for pulling docs from Google Drive and making edits. But if you want to knit an .Rmd to Google Drive it uses the
rmarkdown knits to some pretty heavyweight html that Google Drive doesn't interpret well. The other option is .docx but you know the issues there.
So something along the lines of what I was saying earlier is required. Or maybe someone else has a better idea. I'd be happy to hear it.
The html is all themeable so you could try with a lighterweight template.
html_vignette() would be one place to start since it was designed to generate a small html file suitable for embedding in R packages.
Can I knit a minimal html without bloat?
I also noticed https://github.com/ropenscilabs/gdoc which seemed to be the solution I'm looking for in knitting to google docs - but it's marked as abandoned. Does it no longer work, or is there an alternate package that achieves those aims?
That (https://github.com/ropenscilabs/gdoc) was an rOpenSci Unconf project (I was part of it).
There is no successor. Or rather the successor is the stuff you see in this thread, i.e. @milesmcbain's experiment.
The problem we ran into is that compiling
.Rmd to Google Doc is not that hard. But for the whole workflow to truly be useful, you then want to go the other direction. And that is really hard.
With the launch of the Google Docs API, are we looking at possibilities for improved connectivity from R? https://developers.google.com/docs/api/
This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.
If you have a query related to it or one of the replies, start a new topic and refer back with a link.