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.

Perform this task from the TERR console. Always use the version of TERR that is installed with your TERR service.
  • On Windows, you can perform this task either from TERR running on the command line, or from the TERR console available from the TERR Tools menu in Spotfire Analyst.
  • On Linux, perform this task from TERR running on the command line.

Prerequisites

  • Review the SPK information in this Help.
  • You must have access to the TERR console, version 4.5 or later.
  • You must have access to the Spotfire Server deployment area.
  • You must have access to an internet connection that allows you to download packages from CRAN.
  • You must build a package for the operating system on which your Spotfire Server node manager is installed.

Procedure

  1. From the TERR console, install the packages you want to include in the Spotfire SPK.
    This example shows installing only two packages with no dependencies. You can install any number of required and tested packages; however, you must include all packages that are dependencies, also.
    install.packages(c("plyr","zoo"))
    Note: If you are running Windows, you can install the packages you want in Spotfire Analyst, from the TERR Tools Package Managment dialog box.
  2. In the TERR console, generate a list file.
    In this example, we create the Debian Control File (DCF), which is a list file that contains the two sample packages.
    writeLines("Packages: plyr,zoo", "ServerSPK.dcf")
  3. Load the library that contains the functions to create the SPK for Spotfire Server.
    library(SpotfireSPK)
  4. In the TERR console, call the function that creates the SPK, and pass in the name of the DCF you created, and then add the packages to an SPK named ServerSPK.spk.
    buildServerSPK("ServerSPK.dcf", "ServerSPK.spk")
    The Spotfire package file is created and is ready to be placed in the Spotfire Server deployment area. Make a note of its location.
  5. Open a browser window and log in to Spotfire Server as the administrator.
  6. Click Deployments & Packages.
  7. Under Software Packages, click Add Packages.
    The Add packages dialog box is displayed.
  8. Browse to the location of the new SPK file, and then select it to add it.
  9. Validate the area, and then save the server page.
  10. Confirm updating the node if you are prompted to do so.

Result

The packages are added to the Spotfire Server node manager where the TERR service is deployed. They are ready to use in a visualization published for users of the Spotfire Web Player.

If you already installed the TERR service to your node manager, you must upgrade the service for the newly-installed packages to be deployed.

Related concepts