R Usage In Unix And Linux
Some information on using R in Unix or Linux
R has the concept of a workspace as well as a personal library/package area. (Libraries are collections of packages; packages are sets of R code and/or data that someone has combined and made available. Similar in concept to matlab toolboxes or C++ libraries or Weka jar files).
In general, installing packages/libraries in the main R library folder is not possible. You should normally do it in your personal workspace. However, unless you tell the R environment where to look for your personal packages, it won't be able to invoke them. Hence, you need to set the R_LIB environment variable.
Generally, the recommended way is to create a .Renvironment file in your home directory. This can hold various configuration options, including default page sizes and so forth. You then store the name of this file in the environment R_ENVIRON (examples of the R_ENVIRON exist in the USER_SCRIPTS directory
).
To set the R_LIB environment variable, you add this line to the .Renvironment file:
R_LIB=/path/to/yourRlibraryDirectory
NOTE: If you may be working in more than one type of Unix environment, you should have a .Renvironment file for each flavor. This is because parts of the Packages may be implementing C/C++ or Fortran code. Examples of how to automatically choose the right .Renvironment file can be found in the USER_SCRIPTS directory).
