Recently I've made the switch from Windows Vista to Ubuntu Linux. After switching, the first thing I needed was an editor for R package. R is my favourite and most-used environment for statistical computing. It is free and simple yet a very powerful tool for simple to high profile statistical computing.
I have done a small research on this and found several candidate software. Emacs and ESS (Emacs Speaks Statistics) turned up with maximum hits when I searched in Google. Most frequent R-users rely upon Emacs and ESS (Emacs Speaks Statistics) for obvious reasons. I will review Emacs and ESS in a separate post. In this post, I will limit discussing about using gedit and Rgedit as a frontend for R statistical package.
gedit is the default text editor in Gnome environment in Linux. And gedit has a simple but very useful plugin called Rgedit that makes it an excellent IDE for R. Of the many features of Rgedit, here I list only a few.
Installation of Rgedit
Download and extract from http://sourceforge.net/projects/rgedit/
The detailed instructions are available in the Readme.txt file. I am copying from it:
To install, extract the RgeditXX.tar.bz2 archive somewhere and copy the contents of the resulting folder into to your ~/.gnome2/gedit/plugins folder (please note the "." dot; create this folder if necessary). Now, your ~/.gnome2/gedit/plugins folder should also contain:
RCtrl <- this is a folder
RCtrl.gedit-plugin
RCtrl.preferences
RCtrl.py
ReadMe.txt <- this ReadMe.txt file
Then activate the "R integration" plug-in from gedit (Go to Edit > Preferences > Plugins, and activate the 'R Integration' plugin)
Syntax Highlighting
If you are searching for "syntax highlighting for R" then find no more. Its there in gedit. All you need is to enable the options when you use gedit.

Shortcut Keys
One of the nice features of RGedit/gedit is that you can define your keyboard shortcuts yourself. Its built in shortcuts are also very intuitive. Some of them are listed below:
To define custom shortcuts, open gedit and from the menu, go to R > Configure R Interface > Edit Keyboard Shortcuts. I've defined two new shortcuts, (i) Shift+Alt+S to open a new R session, (ii) Shift+Alt+Q to close an R session. See the keyboard shortcut configuration screenshot below.

Example of shortcut keys with Rgedit
Some must-have plugins for gedit
The default gedit comes with a few plugins. If you are using gedit for editing/writing and managing R codes, then you need the following plugins.
How to get these extra plugins?
If you are using Ubuntu Linux, go to a Terminal and type the following at the prompt:
sudo apt-get install gedit-plugins
After installing, open gedit, and enable the plugins from Edit > Preferences > Plugins
Comments
Re: Using gedit or Rgeidt with R
Hey man!
Nice posting. I am using RGedit, and just added code comment / bracket completion! Thanks a lot.
Do you know if it is possible to add a function recognition (highlighting ) functionality on GEdit?
thanks!
drp
Re: Using gedit or Rgeidt with R
Thanks!
I did not explore that yet. If I know, I will post here as a comment. If you find by then, please do let me know. Thanks in advance.
Re: Using gedit or Rgeidt with R
I could not find the highlighting functionality yet, but code-folding for GEdit is very useful:
http://code.google.com/p/gedit-folding/
Let me know if you find something! :)
Thank you, drp
Re: Using gedit or Rgeidt with R
Not sure this is what you meant, but View -> Highlight mode -> Scientific -> R
Re: Using gedit or Rgeidt with R
By that I meant how to enable syntax highlighting for R in gedit.
Post new comment