How to install new packages in R

If you use R via rcinfo you have no permission to install new packages in the library folder where the program is saved. Nevertheless, you can create your own library folder in your home directory. To get to know the path, start R and use the command:


The output is a path where you have to store all the new packages you want to use. Normally, the given folders do not exist - so you have to create them once. Then you can download the files with the packages manually and save them where you want. To integrate them into your library, you have to use the following command from your console, not from R:

R CMD INSTALL -l /path/to/library /path/to/package/pkg1 /path/to/package/pkg2 ...

There, /path/to/library is the path you just created and /path/to/package/pkg1 /path/to/package/pkg2 … are the packages you want to integrate with their corresponding paths. After the installation, you can start R again and load the packages via the command


into the program. Then you can use it as often as you want to.