How to Use Open-source R on TIBCO Cloud Spotfire


Open-source R provides plotting functions (such as pairs() and qqplot()) and other functions that are not available in Spotfire® Enterprise Runtime for R (a/k/a TERR™). These plotting functions can create visualizations that are not easily created in Spotfire. If you have a local installation of open-source R, then you can load the TERR package RinR and write a Spotfire data function that calls an R function to create an analysis.

The open-source R language is also now available on TIBCO Cloud Spotfire, so if you are using TIBCO Cloud Spotfire Analyst,  you can upload the data function to the TIBCO Cloud Spotfire library for Business Authors to use.

In the following example, you will open a trellis scatter plot that uses the pairs() function in R. (You can easily edit the analysis or the data function to use your own data.)

To view a data function that uses open-source R in Spotfire:

  1. In the Files and data flyout, search for TERR_PairsPlot_Store and open the analysis.
    Comment: The pairs() function used in this data function can be useful for creating a trellis scatter plot to compare the relationships of columns.

  2. Response: The sample data table 'Store' is loaded, and the data function is run. It shows the resulting R output: a PNG, which is displayed in a text area in the analysis.

  3. If the Filters panel is not already open, select View > Filters and filter the data. For example, clear the check boxes for two of the business locations.

  4. Comment: The PNG is a static graph; however, you can use the Filters panel to filter the data and redraw the PNG.

    Response: The data function reruns, using the filtered data and the output PNG is redrawn.

  5. Click the Details tab and review the script description, the input parameters description, and the output parameters description.
    Comment: After reviewing the information, click the Analysis tab to return to the visualizations.

  6. On the menu bar, click Data > Data function properties.

  7. Comment: You can use the Data Function Properties dialog to review and edit the script, view and edit the input or output parameters, copy the data function, and save the copy to your library to edit for your own data.

  8. On the menu bar, click File > Save as, and save your own version of the analysis as a file on your local drive, or directly as an item in the library.

See also:

How to Register a Data Function

How to Debug a Data Function

How to List the CRAN Packages on TIBCO Cloud Spotfire