R functionality is provided in terms of its packages. There are now over 10000 R packages in CRAN.
Packages contain R functions, data, and compiled code in a well-defined format. The directory containing the packages is called the library. R ships with a standard set of packages. Non standard packages are available for download and installation. Examples of R packages include arules,ggplot2,caret,shiny etc. Packages can be installed with the install.packages() function as shown below.
Install.packages(“”)
This command causes R to download the package from CRAN. Once you have a package installed, you can make its contents available to use in your current R session by using the library command: