January 25, 2013

Rstudio, not vim, for reports

I just wasted a dozen hours scattered over several days testing out vim instead of r-studio for when I am writing longer reports with a lot of text in markdown as well as code. My motivation was this:

  • I wanted my source file and the R console side-by-side vertically to give more room to the source code without squashing the console
  • I wanted proper code folding of my markdown text, getting as close as possible to the holy grail of outliners, which is still, incredibly, Microsoft Word’s outline view.

So I went through all the hassle of installing vim (and gvim for a more graphical approach) on my ubuntu box. I got R integration working OK in gvim, Tried voom http://www.vim.org/scripts/script.php?script\_id=2657 for additional outlining support but it didn’t work properly for me. Tried various vim plug-ins to get syntax highlighting and folding to work in vim, such as https://github.com/plasticboy/vim-markdown/blob/master/after/ftplugin/mkd.vim. Managed to get ftplugin to work OK on .md files but not on .Rmd files, which is what I need for R.  Likewise, I couldn’t get R integration to work for .md files.

More importantly though, I just don’t see that these kinds of clunky folding solutions come anywhere near the outline dream of Word (or freeplane for that matter). You can’t promote, demote sections, move up and down, etc. Not worth changing my whole workflow away from Rstudio.

Then I took a minute to read the documentation and changelog for Rstudio and realised that the newer versions have support for sections in code which work outside code chunks, and are sort-of compatible with markdown. So at least I can expand and collapse all markdown sections, which is pretty good. Plus, I realised that you can indeed move the console to its own vertical pane (perhaps you could always do this and I just missed it).

So here I am back with Rstudio and pretty happy all round.

reproducibleResearch nerdvana

Previous post
The five-year plan is dead, long live the five-year plan! Interesting discussion taking place on the XCEval mailing list. Deborah Rugg, UNEG Chair and OIOS IED Director, posted selective highlights of final
Next post
Haiti: Request for Qualifications for research teams to conduct an impact evaluation of the Integrated Neighborhood Approach (INA) Very proud and happy to see that this idea, which we developed while I was in Haiti with the IFRC, is nearing fruition: 3ie will be issuing a

This blog by Steve Powell is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License, syndicated on r-bloggers and powered by Blot.
Privacy Policy