|
|
|
||||||
|
Installing R Libraries Locally in Your Home DirectoryOften it is desirable to have libraries available to all users, other times if you just want to quickly test something it's easier to install the library locally. Add-on packages on CRAN come as gzipped tar files named pkg_version.tar.gz, which may in fact be bundles containing more than one package. By default R wants to install these to the library tree rooted at the first directory given in R_LIBS, if set, and then to the default system library location otherwise. So we'll have to create a directory in the home directory, set a variable to point R at that directory, and then install the package At the shell prompt type:
Alternatively, if you have downloaded the package you can do:
So you don't have to type it every time, put the setenv
command in your .cshrc.more file or even better, put the following
line in a file called .Renviron in your home directory: You can have several R library directories if you wish to separate differnt libraries. Just add these directories to the setenv line, or .Renviron file,
like so: Then, to specify the directory to install to use: where lib_directory gives the path to the library tree to install to. |
|
If you have trouble accessing this page, or need an alternate format contact webmaster@stat.osu.edu. |