Installing packages

Part of the power of R is that tools developed by users around the world can be integrated into the R’s general functionality. Such tools are integrated into containers called packages, and deposited into the R repository for anyone to use. There are so many tools already developed that chances are there is a packages for anything you may need.

The directory of available R-packages is available here. You can click on any available package to learn more about it, including instructions on how to use them.

The primary way to install a package is using the command:

# install.packages("raster")

Between brackets should be the name of the package you want to install. You will be prompted to select a mirror. If this is the first time installing a package, you will also be asked to select a folder where to install the packages. I suggest you accept the default suggestions that are provided.

Once installed in your local harddrive, you need to load the packages into your console every time you want to use it. To do so, you use the command:

library("raster")
## Warning: package 'raster' was built under R version 4.3.3
## Loading required package: sp

Between quotations is the name of the raster. Rlease remember that R is case sensitive.