I love R, and I'm a real ggplot2 nut ... but writing complex programs in the R console, or the built-in editor, has never been my thing. Enter TextMate — its a great editor for writing R scripts in OS X. By using TextMate as your R script editor you get a lot of niceties such as syntax highlighting, multiple carets, jump bars for navigating the workspace, code completion, code folding, and much more.
It really is great, and best of all is that turning on R support in TextMate is very easy: it's done through the Bundles tab in the Preferences window (TextMate > Preferences...). Its as easy as just clicking the checkmarks next to the Bundles named "R", "R Console (R.app)", and "R Console (Rdaemon)".
Once you've turned on R support you're ready to go. As long as your scripts have a ".R" extension, TextMate will recognize them properly. If they don't, you can just select "R" from the Language jump bar at the bottom.
Back in my Comp Sci undergrad days, my Data Structures professor always said
writing code is easy, but debugging is hard!
and having R syntax highlighted makes developing, and debugging, complex R programs a lot easier.
But the thing that really makes TextMate a great R development environment is the shortcuts: hit "command-R" (⌘-R) and the script will run in R and its output will be in available in TextMate's "Runtime" window. Don't want to run the entire script? Just highlight the lines you wish to run and hit ⌘-R.
Forgot the syntax for that pesky data.frame function? No problem, TextMate's code-completion has you covered, just hit "control-period" (⌃.) to bring up the suggestion list.
There are shortcuts for "R" and the "R Console", and you can view all of them by going to "Bundles > R" or "Bundles > R Console" in the menu bar.
Add to all of this the Git bundle, and TextMate is just bananas for R development.
"Peanut Butter, meet Chocolate!".