Package Management for TERR Service
If you create a Spotfire analysis that uses R packages from a repository like CRAN, then you must make sure that the packages are installed on Spotfire Server.
R programmers in your organization can develop their own packages for use in Spotfire. Alternatively, an analyst developing a data function for a Spotfire analysis can take advantage of one of the thousands of compatible packages developed by other R programmers. The largest and most commonly-used, curated repository for R packages is the Comprehensive R Archive Network (CRAN). Most packages that are not installed with the TERR service are downloaded from this repository. Comprehensive testing results for CRAN package compatibility are available for Windows and Linux.
- Coordinate with the author of a Spotfire data function to ensure that all R packages that are used in the analysis are installed on the host computer running the nodes that the TERR service is running on.
- Ensure that all required and dependent packages associated with the needed packages are also installed. (The author of the data function can provide the administrator with this information.)
You can install packages for the TERR service in two ways.
- Use the SPK mechanism on the Spotfire Server. Packages are stored as part of the deployment and are accessible to a TERR service engine running on a node when the engine session is created. This package installation method requires that you create and manually maintain a Debian Control File (DCF) that lists all packages to be installed, including dependent packages. Because the DCF controls SPK versioning, it provides better package governance than directly uploading to the server.
- Manually install packages on the host computer running the TERR service. This method makes the packages accessible to a TERR service engine running on a node when the engine session is created. This method is the most efficient, because calling install.packages() directly on the server ensures that all dependent packages are also installed. If you use this method, you must specify the package path in the custom configuration file.
- Find help
Spotfire® includes many avenues to help with packages, whether they are R language packages to use with TERR™ or Spotfire packages (SPKs). - The Spotfire SPK
A Spotfire SPK is usually created and tested by developers to package and deploy third-party extensions to the Spotfire Server, which can then be distributed to Spotfire Analyst users, or distributed to the Spotfire Server node for use by another service. - Creating an SPK to put a CRAN Package on Spotfire Server
By running a few lines of TERR code, you can create a Spotfire SPK that you can deploy to Spotfire Server for use by the Spotfire Web Player. - Installing R Packages Manually
If you have write permission to the computer hosting the TERR service, then you can install packages to a specific location manually, and then point to the package location in the custom configuration. - Creating a Spotfire Analysis to Display Installed Packages
You can create a data function for a Spotfire analysis that displays a table of all packages installed and available to the TERR engine running in your TERR service.