INSTALL {utils} | R Documentation |
Utility for installing add-on packages.
R CMD INSTALL [options] [-l lib] pkgs
pkgs |
a space-separated list with the path names of the packages to be installed. |
lib |
the path name of the R library tree to install to. Also accepted in the form --library=lib. Paths including spaces should be quoted, using the conventions for the shell in use. |
options |
a space-separated list of options through which in
particular the process for building the help files can be controlled.
Use |
This will stop at the first error, so if you want all the pkgs
to be tried, call this via a shell loop.
If used as R CMD INSTALL pkgs
without explicitly specifying
lib
, packages are installed into the library tree rooted at the
first directory in the library path which would be used by R run in
the current environment.
To install into the library tree lib
, use
R CMD INSTALL -l
lib
to the library path for
duration of the install, so required packages in the installation
directory will be found (and used in preference to those in other
libraries).
It is possible that environment variable TMPDIR
will need to be set (although R CMD
tries to set it suitably
otherwise): use forward slashes and no spaces for the path to a
writable directory.
Both lib
and the elements of pkgs
may be absolute or
relative path names of directories. pkgs
may also contain
names of package archive files: these are then extracted to a
temporary directory. These are tarballs containing a single
directory, optionally compressed by gzip
, bzip2
,
xz
or compress
.
Finally, zipped binary packages (as created by
R CMD INSTALL --build
) can be supplied.
Tarballs are by default unpackaged by the internal untar
function: if needed an external tar
command can be specified
by the environment variable R_INSTALL_TAR: please ensure that it
can handle the type of compression used on the tarball. (This is
sometimes needed for tarballs containing illegal or unsupported
sections, and can be faster on very large tarballs. Setting
R_INSTALL_TAR to tar.exe has been needed to overcome
permissions issues on some Windows systems.)
The package sources can be cleaned up prior to installation by
--preclean or after by --clean: cleaning is
essential if the sources are to be used with more than one
architecture or platform.
If the attempt to install the package fails, leftovers are removed.
If the package was already installed, the old version is restored.
This happens either if a command encounters an error or if the
install is interrupted from the keyboard: after cleaning up the script
terminates.
For details of the locking which is done, see the section
‘Locking’ in the help for install.packages
.
Option --build can be used to zip up the installed package
for distribution.
By default a package is installed with static HTML help pages if and
only if R was: use options --html and --no-html to
override this.
Packages are not by default installed keeping the source formatting
(see the keep.source
argument to source
): this
can be enabled by the option --with-keep.source or by setting
environment variable R_KEEP_PKG_SOURCE to yes
.
Use R CMD INSTALL --help
for concise usage information,
including all the available options.
The options do not have to precede pkgs on the command line, although it will be more legible if they do. All the options are processed before any packages, and where options have conflicting effects the last one will win.
REMOVE
and library
for information on
using several library trees;
update.packages
for automatic update of packages using
the internet (or other R level installation of packages, such as by
install.packages
).
The section on “Add-on packages” in “R Installation and
Administration” and the chapter on “Creating R packages” in
“Writing R Extensions”
(on the Help menu in RGui
),
RShowDoc
and the ‘doc/manual’ subdirectory of the
R source tree).