I do R work on Mac, Windows and *nix. Here are my editing preferences for the platforms.
For *nix platforms (including Mac OS X) I use Emacs
. Emacs should be thought of as a long term investment: time put into learning it will eventually pay off in higher productivity. Emacs does auto-indenting, syntax coloring and a million other things, including psychotherapy. I learned with the help of one of the many Emacs cheat sheets available on the web. I found one I liked, printed it and put it in a notebook. I then decided to do all my editing in Emacs. Every time I hit a point where I didn't know how to do something I wanted to do I forced myself to find out how to do it in Emacs. I then wrote down the keystrokes in my notebook. Within a few days I had almost all of my favorite keystrokes recorded in the notebook and could move around Emacs almost as quickly as I could vi.
I've tried to use Emacs on windows but haven't had great success with it. The key strokes don't work the same way, nor does it do syntax highlighting in color. If I was willing to work on it I could probably figure out the problems but I haven't really wanted to. Digging around in Windows funk is miserable. Luckily there is an editing alternative I like for Windows called Tinn-R
Tinn-R is free and easy to use. Anyone who can handle notepad should be able to figure it out.
A feature novice programmers appreciate is the automatic bracket matching it does. When you open or close a parenthesis or a curly brace Tinn-R will highlight the matching parenthesis or brace. It's a toy editor compared to Emacs with some real limitations; I still go into Windows emacs from time to time, but I'd say it does 95% of what I need it to do, and with a minimum of fuss. Another nice feature is that it integrates with the R GUI, you can highlight a section of code for example, in the editor and send it to R for evaluation by clicking up a toolbar button.Jedit
is another option. Written in java it has the advantage of being available on all platforms.
There is R syntax package available for it and it is quite powerful. It's an IDE
type editor, not too hard to figure out if you've used those before. Some people find it too slow, but I've been happy with it, for the most part. It used to crash and freeze a lot, but is better now. It is a secondary tool for me, but still a useful one when I want an IDE type interface.