R Package
An R Package is a function library (source code) that is compatible with an R distribution.
- AKA: R Function Package.
- Context:
- It can be referenced by an R Expression (in an R program or R command-line session).
- It can be either an R Source Package or an R Binary Package.
- It can be in the form of individual files or a file archive (such as a tarball or ZIP file).
- It can be downloaded from CRAN Service, with a command such as
install.packages("package_name")
- It can be listed with the
library()
R command. - It can
- Example(s):
- an Standard R Package.
- a Contributed R Package (http://cran.r-project.org/web/packages/available_packages_by_name.html), such as:
- R rmr - functions providing Hadoop MapReduce functionality in R
- R rhdfs- functions providing file management of the HDFS from within R
- R rhbase - functions providing database management for the HBase distributed database from within R
- R rpart - recursive partitioning and regression trees.
- R sqldf - Manipulate R data frames using SQL.
- R igraph - graph data
- R gbm - generalized boosted regression.
- R forecast, R hts, ...
- SparkR.
- See: R Programming Language.
References
2013
- http://www.inside-r.org/r-doc/base/library
- library and require load add-on packages.
- Usage
- library(package, help, pos = 2, lib.loc = NULL, character.only = FALSE, logical.return = FALSE, warn.conflicts = TRUE, quietly = FALSE, verbose = getOption("verbose"))
- require(package, lib.loc = NULL, quietly = FALSE, warn.conflicts = TRUE, character.only = FALSE)
- … library(package) and require(package) both load the package with name package. require is designed for use inside other functions; it returns FALSE and gives a warning (rather than an error as library() does by default) if the package does not exist. Both functions check and update the list of currently loaded packages and do not reload a package which is already loaded. (Furthermore, if the package has a namespace and a name space of that name is already loaded, they work from the existing namespace rather than reloading from the file system. If you want to reload such a package, call detach(unload = TRUE) or unloadNamespace first.)
2010
- http://cran.r-project.org/doc/manuals/R-exts.html#Creating-R-packages
- QUOTE: Packages provide a mechanism for loading optional code, data and documentation as needed. The R distribution itself includes about 30 packages. …
A package is a directory of files which extend R, either a source package (the master files of a package), or a tarball containing the files of a source package, or an installed package, the result of running
R CMD INSTALL
on a source package. On some platforms there are also binary packages, a zip or tarball containing the files of an installed package which can be unpacked rather than installing from sources.A package is not[1] a library. The latter is used in two senses in R documentation. The first is a directory into which packages are installed, e.g.
/usr/lib/R/library
: in that sense it is sometimes referred to as a library directory or library tree (since the library is a directory which contains packages as directories, which themselves contain directories). The second sense is that used by the operating system, as a shared library or static library or (especially on Windows) a DLL, where the second L stands for `library'. Installed packages may contain compiled code in what is known on most Unix-alikes as a shared object and on Windows as a DLL (and used to be called a shared library on some Unix-alikes). The concept of a shared library (dynamic library on Mac OS X) as a collection of compiled code to which a package might link is also used, especially for R itself on some platforms.
- QUOTE: Packages provide a mechanism for loading optional code, data and documentation as needed. The R distribution itself includes about 30 packages. …