Installation Options for Packages
Use the function
install.packages()
to install packages to use in
TERR
either in the stand-alone console, or in
Spotfire.
You can find packages in a variety of locations, including repositories, on
reliable web sites, or stored locally. See the
TERR
help topic for
install.packages()
for more detail and examples.
Package Location | Description | Example |
---|---|---|
TERR Archive Network (TRAN) repository | The default location,
https://tran.tibco.com, for installing
packages using
install.packages() . Used for packages that have
been customized to work specifically with
TERR.
Requires no further arguments.
Note:
Some packages customized and placed on TRAN require other packages not available on TRAN. Some of these packages cannot be installed using the
TERR function
For information on the installation differences between TERR and open-source R, see Specifying an older package from TRAN. |
|
Microsoft R Application Network (MRAN) CRAN mirror repository | The second value in
options("repos") is initialized to a URL to the
MRAN repository, which contains snapshots of the CRAN packages on any given
date. This URL specifies a fixed date on MRAN and will not access CRAN package
versions after that date.
|
|
Comprehensive R Archive Network (CRAN) repository | CRAN is included in the default
options("repos") to handle cases where the
package is not available on TRAN or on MRAN (probably because it is a new
package). If the default does not work, you can call
install.packages setting the
repos argument. One case where this option is
useful is when accessing other repositories (such as Bioc).
|
|
In-house repository | You or someone in your organization has set up a CRAN-like repository (either on a network share or on a web server) using a tool like the drat package. All TERR or open-source R users in the organization can access the same package version from the repository. |
|
Locally-available packages | If a trusted source gives you a package as a
zip archive, you can put in on your computer and install it using
install.packages() .
|
|
Trusted URL | If you are given a URL that contains a
package you might want to use, and you trust the URL, you can pass the URL as
the only argument to
install.packages() .
|
|
The repositories contain binary packages (for Windows) and source packages (for Linux and Windows). You can easily install most binary and source packages in TERR. If you have problems building from source, then build the packages using open-source R before installing them into TERR. Note that TERR does not build binary packages from source packages that contain Java source code.
Platform | Package type | Notes |
---|---|---|
Linux, Windows | Binary | Call
install.packages(pkgname) .
TERR installs the binary package into your specified package directory.
|
Linux | Source; no Java code, no C/C++ or Fortran code | Call
install.packages(pkgname) .
TERR builds the source package into a binary package and installs it into your
specified package directory.
|
Linux, Windows | Source; C/C++ or Fortran code (no Java code) |
Note: On
Windows, first you must install the Rtools utilities package, which is
maintained by Duncan Murdoch, and then update your PATH to specify the location
of the utilities.
Note: See
Installation Options for Packages
for information on repositories accessed by
TERR builds the source package into a binary package and
installs it into your specified package directory.
install.packages .
If the package does not build and install, then try building it with open-source R, and then installing the binary as described here. |
Linux | Source; Java code |
|
See the help for
install.packages(pkgname)
for more
information.
- To install a binary package from a repository, always call
install.packages(pkgname)
from TERR. Theinstall.packages
function finds the correct binary version in the repository for your version of TERR. Manually downloading the binary package from CRAN can result in errors when you use it with TERR. - To install a package from source, try installing it first with TERR (with
install.packages
in TERR or withTERR CMD INSTALL
from a command line). - To install a package from source that you cannot build with TERR, install the package with the version of open-source R tested with TERR.
ap <- available.packages(contrib.url(getOption("repos")[1],
getOption("pkgType")))
# to print the entire matrix
ap
# to print just the package names
row.names(ap)
- Setting JAVA_HOME
Some packages that you use with TERR require access to Java on your system. If you call the TERR functionSys.getenv("JAVA_HOME")
and it returns an empty string, you must set JAVA_HOME so the packages can access Java. - Installing the rJava Package
The rJava package gives access to low-level R functions to the Java interface, but it is not provided with TERR. These instructions help you prepare your computer to use rJava.