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 install.packages, so the TRAN package cannot be successfully installed. If you encounter this situation, try building and installing the package using open-source R. For information on the installation differences between TERR and open-source R, see Specifying an older package from TRAN. |
# install R Datasets Package found on TRAN: install.packages("datasets") |
Comprehensive R Archive Network (CRAN) repository | The secondary location for installing packages using install.packages(). Requires no further arguments. (See the following note for important information about installing source packages from CRAN.) |
# install rpart package from CRAN: install.packages("rpart") |
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. |
#download and install from a # local web service using a URL: URL <- "https://mycompanysvc/mypackage") install.packages(URL) |
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(). |
# install local newtree package # from a zip file in the working directory: install.packages("newtree_1.2.zip") |
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(). |
#download from a custom URL and install # a custom package URL <- "https://customurl/mypackage") install.packages(URL) |
The CRAN repository contains 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.
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. The install.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 with TERR 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.