Saturday, March 23, 2013

RStudio with R-devel

So I discovered RStudio last year and I've been hard-put to find a better code-development software for R. I have also used the Rvim plugin with Tmux as very adequately explained here. Both have advantages -- RStudio offers a really nice working environment for scripting, debugging, reading vignettes, and the like, while Rvim really allows a coder to make use of all the goodies in vim.

Recently, as part of an effort to code something for Bioconductor, I had to switch from R 2.14 to the latest development version of R. Getting the code wasn't too bad. I just went over to the CRAN website and under the header in the picture below, I was able to download the code to a folder under my Documents. But from there, opening up RStudio was leading to an error saying "Unable to locate R binary by scanning standard locations". At the time, I still had Rvim so I just continued working with Rvim and did without RStudio.

But as time went on, I really began to miss the ease-of-use of the RStudio workspace. So I looked up the relevant RStudio support page and found that the key to the problem was two-fold:
  1. I had forgotten to move the R-devel folder to "/usr/bin/R" which is where RStudio looks for R versions. 
  2. I had neglected to add the R-devel/bin/R to my PATH variable. 
Fixing those two errors now gives me a functional RStudio workspace with the latest R version

1 comment:

  1. Could you put the commands that you use for these changes?

    ReplyDelete