use packages in r
#Install package.
install.packages("<package_name>")
#Load the package to use it in your code.
library (<package_name>)
#NB: If using an anaconda environment, install packagesin your terminal by
#running code below:
conda install r-<package_name)