switcherswitcherswitcherswitcher

User login

Who's online

There are currently 0 users and 7 guests online.

Who's new

  • vsn3480
  • fengzhixuan
  • caseybergman
  • tomas81
  • raju_dharna

RSS Feeds

Technorati

Installing R/BioConductor on Ubuntu Linux

I'm just starting to learn and use R (and BioConductor) for quite a fair chunk of analysis on my PhD. I'd definitely recommend R if you need to do any major stats/maths work.

However, when setting things up on Ubuntu, I came into a few problems here and there, so I thought I'd just share the workarounds with you all in case someone else starts to struggle...

The version of Ubuntu that I'm using is the current Beta release of 7.04 (Feisty Fawn), but this should also be applicable to older versions of Ubuntu and possibly Debian Linux.

First up, run these commands in a terminal:

sudo apt-get install build-essential g77
sudo apt-get install refblas3 refblas3-dev
sudo apt-get install r-base-core r-base-dev r-bioc-repostools r-recommended

This will then install the R base packages and some of the BioConductor packages, along with the gcc and fortran compilers and some other libraries that will be required for the next step.

sudo -s
R

Now at the R prompt, type the following…

source("http://www.bioconductor.org/biocLite.R")
biocLite()

Now sit back for a few minutes while your system configures the rest of a basic install of BioConductor for you! :)

If there are anymore BioConductor packages that you would like installed, you can reuse the 'biocLite()' command as follows:

biocLite(c("pkg1", "pkg2"))

Where "pkg1" and "pkg2" are the names of the packages you would like to install. Further details on this can be found on the BioConductor Install page.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Submitted by Mark Ewing (not verified) on April 21, 2007 - 6:17am.

Do you know if R for Unbutu has an interface like the one for Windows? I'm curious because I'm a statistician and I write long scripts in R so I can save them and review them later. This method only seems to get R running in the terminal window where I cannot save my scripts. Thanks for the helpful information though!

Submitted by perlmunky on April 22, 2007 - 10:09pm.

Hi Mark,

I have been looking for something that works well with R in the linux environment. The funny thing is that the best I have found is an xemacs plugin.

http://socserv.mcmaster.ca/jfox/Books/Companion/ESS/

Check it out ... one of the post-docs in the lab swears by it.

/(bb|[^b]{2})/

Submitted by Abhijit (not verified) on May 1, 2007 - 12:18am.

Hi Mark,

I'm a statistician at a major hospital, and I've also worked as such at NCI. I tend to write rather long custom scripts in R, either for particularly large projects or for my microarray analysis work.
I have regularly used emacs/xemacs with the ESS (Emacs Speaks Statistics) plugin both on linux and Windows. My work computer is Windows and my home has both windows and Ubuntu on it, and the same setup works on both, albeit with some tweaks of the directory structure. I've used emacs for over 15 years now, so I'm familiar with it. You might not be. ESS allows a R process to run in emacs, and sending commands from the script file requires either just a few keystrokes or a mouse click on the menus. I will typically run 3 subwindows in emacs...1 for the R script, 1 for the R process and 1 for my Sweave/noweb file for writing my report

Rcommander might be a good option for just a GUI interface, but since you are obviously more sophisticated (using scripts).

Hope this helps

Submitted by Daz on April 21, 2007 - 7:40am.

Unfortunately, the Linux version of R is lacking a really decent interface (on par with the Windows and OS X ones). There are however a few interfaces that I know of that are okay, have a look at the following and see what you think...

Tcl/Tk Interface

This is a pretty basic GUI that is installed by default - it has a command window, basic code editor and facilities to help you install pakages from CRAN. Just start R with the following command:

R --gui=tk

R Commander

Follow the install instructions from here. This is another GUI similar to the above, but a bit better recommended. Alternatively, to install on Ubuntu, just type the following at the shell:

sudo apt-get install r-cran-rcmdr

Other Options

The two above are the only two GUI's i've tried so far as I haven't really looked hard for a GUI (my main working OS is OS X - so i've got a nice GUI already), I mainly use the command-line on Linux. But after a quick google, here are some more options to investigate:

Submitted by Daz on April 25, 2007 - 11:14am.

Just been trying out some of the above GUI's and I have to say that I quite like pmg so far - there's a lot of work to do on it, but it seems very nice (plus as it's based on GTK widgets it looks good on Ubuntu)!

There is an easy install script for Windows machines, but you have to manually install it on Ubuntu. Here's the commands/packages I used to make all of the error messages go away...

$ sudo apt-get install r-cran-cairodevice r-cran-rgtk2
$ sudo R
> install.packages("pmg",dep = TRUE, repos = "http://www.math.csi.cuny.edu/pmg")
> q()

Then just load up R as a normal user and start pmg:

library(pmg)
Submitted by Anonymous (not verified) on May 16, 2007 - 9:29pm.

hi, dear Daz,
Thank you very much for posting out your pmg installation instructions.I followed your instructions above and tried to install pmg in R. It installed without any problems. I am happy to see that I now can get the RGtk2 package works for me, while it always falls when installed online. But when I type in library(pmg) it gives me the following error information. I guess the errors are caused by my GTK version, since when I try to install RGtk2 seperately one error message says that GTK version 2.08 or above is needed for installing RGtk2. Maybe you already installed GTK2.08. May you please let me know how you update your GTK version to 2.08 or 2.10? (My OS is ubuntu edgy). Thank you very much!

Ellen
-------------------------------------
> library(pmg)
Loading required package: lattice
Loading required package: MASS
Loading pmg()
Loading required package: gWidgets
Loading required package: gWidgetsRGtk2
Loading required package: RGtk2
Error in .getAutoMethodByName(x, method) :
No such method SetImage for classes GtkMenuItem, GtkItem, GtkBin, GtkContainer, GtkWidget, GtkObject, GInitiallyUnowned, GObject, RGtkObject
Error : .onLoad failed in 'loadNamespace' for 'pmg'
Error: package/namespace load failed for 'pmg'
>

Submitted by Daz on May 18, 2007 - 10:15am.

The easiest way i know to update your version of GTK is to update your distribution. GTK is the toolkit that Gnome (and most of the packages in Ubuntu) are built upon.

I've not tried any of the above on Edgy, it's only been on Feisty, so I think the best option might be to upgrade your Ubuntu to Feisty.

Sorry I couldn't be more use than that. :)

Submitted by Mikko on September 12, 2008 - 5:33pm.

Hi guys and thanks for nice advices!

I switched to Linux Ubuntu 8.04 from Windows XP about a month ago. Already now I am happy for my decision and wouldn't go back. However, I have been suffering same problem than many here. It seems that R interfaces for Linux are not as handy and well developed than for Windows. I am using R quite a lot and kind of liked Tinn-R interface with it's R card and coloured commands.

For Ubuntu I tried first R commander, but couldn't really figure out how to use it, so I moved to JGR. JGR has most of the abilities I liked in Tinn-R, but it's not possible to have many scripts open at the same time. Also sending lines has been more difficult, since Ctrl + R works only for selected text, not whole line. I addition I haven't figured out a way to stop command input (in Windows it worked with Esc), but I have to clear whole workspace in order to get rid of + lines, if I have made a mistake somewhere in a long line...Also help files seem to be messed up in JGR. Some advanced tihngs seems to work, but when asking help with all basic commands, program can't find the help file. Thus I have to run R parallel in terminal to use help files. In Tinn-R/R/Windows combination it was possible to operate all basic help files by clicking links in the help files.

I have heard about Emacs and ESS, but at first glimpse the program felt quite difficult to handle without any experience with it. After advices on this thread I tried to install pmg. After getting used to written interface, I quite liked it and now button driven interface typical for commercial statistical programs feels awkward to use. Text in command panel is not coloured, which makes spotting typing errors difficult. Pmg is most definitely good for someone, but doesn't fit my needs. I'll try to fiddle around a bit with this program and come back with a new opinion based on more experience.

Has there been any major changes with R interfaces for Linux since last message? Is there a program for Linux, something else than JGR, which would work in similar manner than Tinn-R?

Finding a nice and well-working interface for R would save quite a bit of my (and I guess others as well) time when working with R.

Submitted by brice83 on September 26, 2008 - 1:53pm.

hi, there is a graphic interface for R in linux, it is a kde application but it work well on gnome.i'm using it in ubuntu and i thing it is better than tinn-r.the name is RKward