Navigation
« Notes from A Recent Spatial R Class I Gave | Main | R in the CPB and the role of Open Source in Promoting Transparency and Austerity »
Tuesday
May082012

The Epic Search for the Perfect R Text Editor

 

I can never seem to get exactly what I want from an R text editor. Let me correct that, I can never seem to get exactly what I want from an R text editor on a MAC. I used to use Tinn-R  which met most  my needs:

  • Free,lightweight with an easy install and a slim UI
  • Good commenting and code folding tools
  • Customizable short cuts
  • Support for multiple monitors
  • An R console that was separate from the editor
  • A flexible, simple, and powerful Find and Replace Interface
  •  Good SWeave support with some built in LaTeX tools

 

When I made the switch to Mac I went with StatET  on Eclipse   StatET has more or less all those things, but it is not simple or straightforward (or maybe just Eclipse is too complex for me). It also has somewhat lousy graphics support and does not allow for fuzzy help searches (??’help’). However, it worked so I’ve been using it. But I just upgraded to R 2.15 and the built in graphics driver (and a few other options) no longer work.  I was never that attached to StatET anyway because the Eclipse environment is just too complex for my needs.

 

I really like R Studio  but it’s missing some very key features:

  • The ability to Find and Replace on a selection, rather than the whole document, plus general ‘fancy’ text editing find and replace tools
  • Multiple monitor support (I’d like to be able to detach one of the panes and move them to another monitor)
  • Customizable shortcuts
  • The ability to restart the R console without restarting the editor (this I can live without, but it’s nice to have)

 

So what else is out there? Maybe it’s time to try TextMate? In general I prefer free and cross platform, but I can make exceptions.

PrintView Printer Friendly Version

EmailEmail Article to Friend

References (7)

References allow you to track sources for this article, as well as articles that were written in response to this article.
  • Response
    Mest etablerade akademiska områden har sina egna vetenskapliga tidskrifter och andra försäljningsställen för publicering, även om många akademiska tidskrifter är något tvärvetenskapligt, och publicera arbetet från flera olika fält eller delfält.
  • Response
    Response: Minolta Cameras
    - Frank Davenport's Research Blog - The Epic Search for the Perfect R Text Editor
  • Response
    - Frank Davenport's Research Blog - The Epic Search for the Perfect R Text Editor
  • Response
    Choosing a good text editor - a rather difficult task for today! Infinite number - but the office is very difficult to find something worthwhile, especially with the cloud service!
  • Response
    Response: www.niagara.com.au
    - Frank Davenport's Research Blog - The Epic Search for the Perfect R Text Editor
  • Response
    - Frank Davenport's Research Blog - The Epic Search for the Perfect R Text Editor
  • Response
    Response: MLA paraphrase
    Update really brought new features to the program! Well that it is engaged in the development of a good team that has a new update every week!

Reader Comments (17)

TextWrangler! It's excellent and I think fulfills all your requirements, except cross-platform.

May 10, 2012 | Unregistered CommenterBen

I use notepad++ on Win and Coda on Mac. You might want to try Sublime though, it's cross platform.

May 10, 2012 | Unregistered CommenterHansi

Emacs with ESS? The Aquamacs port to OS X comes with ESS ready installed, and there is an all-in-one package for Windows. I use with R 2.15 and on Linux too.

Very customisable, neat interaction with the R shell. The main downside is that emacs has a long learning curve to get the most out of it. But you managed R....

May 10, 2012 | Unregistered CommenterAlex

TextWrangler (free) should do it for you (TextMate [paid] is it's older brother). You can install applescript hooks to send code to the Mac's R GUI with a keyboard shortcut, which is nice.

May 10, 2012 | Unregistered CommenterMark

I have to agree with the commenter who suggested Emacs.

Emacs Speaks Statistics is so good for R, that I can never imagine using anything else.

Emacs itself is a little weird, but really flexible and productive once you make some adjustmenets. As a bonus, you can use Emacs for pretty much any other coding or writing you do.

The integration of Tex and R in Sweave files is also wonderful, with proper syntax highlighting, lots of useful shortcuts for common tasks.

Seriously, use Emacs. You really won't regret it.

May 10, 2012 | Unregistered Commenterdisgruntledphd

Hi Frank,

The testing release of StatET is compatible with R 2.15.0

http://lists.r-forge.r-project.org/pipermail/statet-user/2012-May/001408.html

With respect to fuzzy searching there is built-in full-text search available from
within the R Help View (or by using Ctrl+H).

Good luck with your epic search,
Best,
Tobias

May 10, 2012 | Unregistered CommenterTobias Verbeke

I have to add a vote for Vim with the vim-r plugin, which works quite well on Mac OSX. I certainly don't want to start a vim vs. Emacs debate here, they are both fine text editors, I just prefer the sexy, black magic of Vim. In general after teaching a course on R and exploring a variety of editing/runtime environments I still find that no IDE-like environment offers the editing tools I need to code efficiently so I always have turned back to a real text editor married to R with scripting as my solution.

May 10, 2012 | Unregistered CommenterForrest Stevens

Another vote for Emacs! I was in the exact same boat as you a while back, frustrated by the lack of a good editor that had everything I needed. I knew about ESS, but resisted Emacs for a while due to the learning curve. I finally gave it a shot and it has literally changed my life, much for the better.

If you work a lot with LaTeX/Sweave, I highly recommend getting the AUCTeX package. It improves the syntax highlighting and adds a lot of useful functionality, but doesn't make anything more complicated, if you don't want to use the bells and whistles.

I also *highly* recommend looking into org-mode, which is another killer package that is now coming bundled into most distributions of Emacs (the GNU Emacs v 24 comes with the most updated org-mode version). One of the many lovely features is that you can embed code chunks in a structured document, not unlike Sweave, but you can embed chunks of *any* arbitrary language, not just R. And the R code chunks still leverage all the handy ESS functionality of being able to run the code as you edit. Org-mode itself is a much "lighter" system of markup than LaTeX, but it has fantastic exporting capability, allowing easy export to full LaTeX, ASCII, HTML, and even OpenDocument formats (which even look good in Word).

But even if you don't head down the org-mode rabbit hole right away, Emacs is definitely worth a look as a great general-purpose editor that works beautifully with R.

good luck,
-scott

May 10, 2012 | Unregistered CommenterScott J

I'm also a big fan of Notepad++ (along with the plugin NppToR to send code directly to an active console) and would highly recommend the editor for Windows users (it also behaves nicely in Linux under WINE). There's good support for syntax highlighting and auto-completion for R commands, etc.

May 10, 2012 | Unregistered CommenterMatt Malin

Stephen Eglen's presentation on all the good stuff: Emacs, ESS, and Org-mode
http://www.damtp.cam.ac.uk/user/sje30/ess11/ess-slides.pdf

May 10, 2012 | Unregistered CommenterAlexander Vorobiev

My favorite mac editor is TextMate with the R bundle.
Fancy editing feature, Sweave support, highly customizable for shortcut etc...
Best few bucks ever spent. The version 2 still in development promise to be epic!

May 10, 2012 | Unregistered CommenterDavid

Ahg, please pardon my brain short circuit above. BBEdit (not Textmate) is TextWrangler's big brother. BBEdit is also an excellent editor, I'm told.

Another twist: if you are considering an iPad in your future, note that Vim is fully supported through SSH (using apps like iSSH).

May 10, 2012 | Unregistered CommenterMark

Big thumbs-up to sublime-text.

I've been an eclipse, jedit, komodo, you-name-it for various languages and platforms. I have been moving to sublime for the last several months and have found the R plug-in acceptable. Sublime is definitely cross-platform (Python-based) and has an active community building extensions.

R-Studio is fantastic but it isn't yet a real multi-pane editor with all of the high-end bells and whistles.

If you're multi-language as I am, an editor/IDE that supports multiple programming idioms is imperative. Having the same control-sequence do the same operations no matter if you are in R, C++, Python, Lisp (commenting, begin/end matching, folding, etc.) is really nice.

May 10, 2012 | Unregistered Commenterripwit

Geany is pretty slick and works great with R in the VTE.

May 10, 2012 | Unregistered CommenterAJC

Another vote for vi. Switch between editor and console with ctrl-z and fg

May 11, 2012 | Unregistered Commentermilktrader

Sublime Text 2! It's super fast, great UI and provides great R support by now. With
https://github.com/karthikram/Rtools
you can easily send selected text to the R console and with
https://github.com/jlegewie/SublimePeek
you have direct access to R help from the editor.

May 14, 2012 | Unregistered Commentergreg

I used Eclipse/StatET, emacs/ESS/org-mode, and RStudio, but always seem to come back to Eclipse for the heavy lifting. What I've found hard to replicate in emacs and RStudio is StatET's fast and complete object browser. Visualization of complex list objects, such as SpatialPolygons, SpatialPolygonsDataFrames, data.table, etc.. has great support in StatEt and is a big productivity booster, and great for catching errors early. I know objects can be explored in ESS as well, but it takes a few keystrokes and is tiresome for long hours of coding. StatET R Help browser (using ? or ??) and immediate help on code mouseover, as well as code completion are very nice as well.

With Eclipse you also get code outlines and bookmarks, and very robust search/replace for "free". These features are available in emacs as well, but I tend to forget the keyboard combinations.

Another nice feature of StatET are code snippets that can be executed on any object in the object browser (e.g. if you use custom printing or plotting commands, I also use snippets to quickly import/export tables to clipboard and into MSExcel or into org-mode format, test and build packages, etc..). Snippets can be bound to keyboard shortcuts, so that's another big booster.

StatET also support interacting with remote consoles (R sessions on remote servers), just as if you were working locally. I've found it hard to replicate this feature in ESS.

Emacs is a fantastic all-around code editor and org-mode is light years ahead of Sweave or RMarkdown when it comes to editing structured documents with references, citations, embedded code chunks, and multiple export formats. On Windows Emacs is a bit of a pain though, takes lots of customization to get it right. Then again I really miss a good R object browser in ESS.

Last I tried TextMate on Windows (1 year ago) it also missed a good R object browser and visualization of data.frames and data.tables -- but TextMate is lightweight and much faster than both Eclipse/StatET and emacs/ESS.

September 7, 2014 | Unregistered CommenterMel

PostPost a New Comment

Enter your information below to add a new comment.

My response is on my own website »
Author Email (optional):
Author URL (optional):
Post:
 
Some HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>