Spotfire® Service for R Installation and Administration

Installing R Packages Manually

If you have write permission to the computer hosting the Spotfire Service for R, then you can install packages to a specific location manually, and then point to the package location in the custom configuration.

About this task

Perform this task on the computer hosting the Spotfire Service for R (in the directory where the R engine is installed), and then on the computer where Spotfire Server is installed.

This method of installing packages is useful for packages that have a larger number of dependent packages. Dependent packages are installed by default, rather than manually, using this method.

Any time you install additional packages or update existing packages, be sure to install them in the directory you specified for your packagePath. You can have only one package path for the Spotfire Service for R installation.

Before you begin

You must have administrative privileges to create a directory where packages are installed. You must have administrative privileges and the tools password to update the custom.properties file.

Procedure

  1. On the host computer, create a directory to hold the packages.
    You need to perform this step just the first time you install packages.
    Example: /opt/r/library
  2. From a command prompt, launch R console.
    The R engine should be available from wherever you installed it and specified in SPOTFIRE_R_HOME or rhome.path.
  3. Install the packages to the directory you created, and where the Spotfire Service for R can find them.
    In this example, the survival package and its dependent packages are installed in the directory /opt/r/library.
    install.packages("survival", lib="/opt/r/library")
    The package and its dependent packages are installed.
  4. Close the R console.
    At the R command prompt, run the command q().
    The R console closes.
  5. Update the Spotfire Service for R configuration to specify the package path.
    You need to export, edit, and reimport the custom.properties file only the first time to set the package path.
    Note: Remember that when you change the custom.properties, you must edit the service configuration with a new name, and then reimport it to have it take effect. See Manually editing the service confguration files for more information.
    1. Follow steps 1-3 in Configuring the Service to export the service configuration file custom.properties.
    2. In the exported custom.properties file, locate the entry for packagePath.
    3. Provide the path that you specified for the installed packages.
      Note: The configuration setting packagePath requires forward slashes (/) regardless of operating system.
    4. Complete the steps to rename, save, update, and import the changed service configuration file, as described in Configuring the Service.