Читать книгу Probability with R - Jane M. Horgan - Страница 33

1.11 Packages

Оглавление

A key feature of R it that it is a library of packages as much as it is a programming language. Packages are a collection of stored functions, data, and code that can be loaded for specific needs. The base installation of R contains a set of packages, which are sufficient for most users' needs. To see what packages are available with the base installation, type

search()

which gives

[1] ".GlobalEnv" "package:stats" "package:graphics" [4] "package:grDevices" "package:utils" "package:datasets" [7] "package:methods" "Autoloads" "package:base"

The library function enables you to see what is available in any particular package. For example, by writing

library(help = "stats")

you will get a list of statistical procedures available in the “stats”package.

By clicking on packages on the toolbar, you will be given a list of available packages. If you want to install a specific package, “Matrix” say, just click on “Matrix.”Alternatively, write

install.packages("Matrix")

in the command window.

library(help = "Matrix")

tells us what procedures are in the package “Matrix.”

installed.packages()

details all installed packages.

Currently, there are thousands of packages available. It is unlikely that you will need any of these at this stage of your learning, as the packages available in the base package are usually adequate for the general users' needs.

Probability with R

Подняться наверх