Statistical Analysis: an Introduction using R/R/Packages

The strength and depth of R comes from the various functions and other objects which are provided for your use. These are actually provided by a variety of separate packages. For example, Figure 1.1 is based on data from the "datasets" package. To use the contents of a package, it must be made available to R, then loaded into your R session.

Some packages should always be available within R, and a number of these are automatically loaded at the start of an R session. These include the "base" package (which is where the and   functions are defined), the "utils" package (which is where   and   are defined), the "graphics" package (which allows plots to be generated), and the "stats" package (which provides a broad range of statistical functionality). In total, the default packages allow you to do a considerable amount of statistics.

However, one of the strengths of R is the variety of additional packages that are available. Packages are, for example, which allow you to analyse genetic data, to interface to geographical information systems, for economic analysis, and so forth. To make a package available to R, you need to download it and install it somewhere on your system. There is a central place (called "CRAN") from where you can download most additional packages. Once you have installed a package, you can load it into R at any time by using the  function.