- Modern R Programming Cookbook
- Jaynal Abedin
- 157字
- 2021-07-08 09:48:28
How it works…
In any of the commands to install a library, either install.packages(), install_github(), or biocLite(), first, it connects with the mirror server where the source code / binary-released version of the specified library is located. Then, it checks whether the dependent libraries are installed onto the computer or not. If the required dependent library is absent, then it will download and install those required libraries before installing the one you specified through the command. The command will also search for the location where the installed library will be stored. You can explicitly specify the location or you can use the default. The recommended approach is to specify a location and install all customized libraries into that folder.
To specify the installation location, you can use the lib= option within the function. Make sure you have created the folder that you are going to use as the destination folder. Here is an example:
install.packages("ggplot2", lib="c:/rPackages")