How to run R
Disclaimer: This is a work in progress started by a novice user of the cluster. Before using any information presented here, refer to the rest of this wiki for information on best practices. Edits are welcome on this page and questions can be directed to Kathleen Gatliffe, who doesn't remember her office number.
Running R Interactively
R code should first be run interactively on a limited data set until it is proven to be stable. R can be accessed and run directly from the terminal by typing R. Commands can be typed or cut and pasted from files. To exit an R session in the terminal type,
The server is preloaded with many R packages. If you need any that are not loaded, you can attempt to install them from R. The first time you do this, the system will deny your request and offer to create a library folder in your home directory. Once this folder is created, any other packages you install will be installed in this folder. Once a package is installed in your library it can be called and used as normal.
Installing package into ‘/usr/local/lib/R/site-library’ (as ‘lib’ is unspecified) Warning in install.packages("name of package") : 'lib = "/usr/local/lib/R/site-library"' is not writable Would you like to use a personal library instead? (y/n) y Would you like to create a personal library ~/R/x86_64-pc-linux-gnu-library/3.4 to install packages into? (y/n) y
In order for the server to compile your code, you must identify it as an R script within a shell file. It is good practice to include creating log and error files within the shell script.
A quick but thorough overview from the Bioinfomatics group at the Berlin Institute of Medical System Biology.