R

Supported Versions

Solano CI supports recent versions of R:

  • R 2.14.1
  • R 3.0.3
  • R 3.1.0

By default R 2.14.1 will be on the path. At the moment you will need to set the environment variable R_VERSION to a supported version string to select alternate versions.

The R_LIBS environment variable will be set to point to $HOME/R_libs. This means that whenever you start R, the directory $HOME/R_libs is added to the list of places to look for R packages and so that for instance the following sequence will work:

> install.packages("ggplot2")
> library(ggplot2)

To install packages for a build, we recommend adding a script to the pre_setup hook that runs an R script to install packages. You may also want to configure the build to cache the results. To read more about configuring caching, see this article.

The default .Rprofile in the home directory, which you can override by replacing it in a setup hook, will contain:

## Default repo
local({r <- getOption("repos")
       r["CRAN"] <- "http://cran.r-project.org"
       options(repos=r)
})

If you you need to start Rserve in the background consider using the following in your solano.yml:

---
hooks:
  pre: bin/pre_setup.sh       # Replace with YOUR worker pre_setup script
  worker_setup: bin/setup.sh  # Replace with YOUR worker setup script
  post_setup: R -e 'library(Rserve); Rserve(args="--no-save")'