This topic applies only to users of TIBCO Cloud Spotfire Analyst.
When you create a data function for users to be able to run on TIBCO Cloud Spotfire, you might want to take advantage of some of the packages from the Comprehensive R Archive Network (CRAN), as well as the packages that come installed with the Spotfire® Enterprise Runtime for R (a/k/a TERR™). However, remember that if you use a CRAN package in an analysis on TIBCO Cloud Spotfire, that package must also be available on TIBCO Cloud Spotfire.
TIBCO Cloud Spotfire includes an archive containing over 500 CRAN packages. You can retrieve this list, along with the versions posted, their dependencies, and their license information, by creating a data function and saving it to TIBCO Cloud Spotfire.
To complete this task, you must meet the following prerequisites.
You must have an account on TIBCO Cloud Spotfire.
You must have downloaded and installed Spotfire Analyst. (See the Help for more information on downloading the compatible version.)
To create a data function that lists CRAN packages on TIBCO Cloud Spotfire:
Open and log into TIBCO Cloud Spotfire Analyst.
Comment: This version of Spotfire Analyst saves analyses to the library on TIBCO Cloud Spotfire.
On the menu bar, click Tools > Register data functions.
Response: The Register Data Functions dialog is displayed.
In the Register Data Functions
dialog, provide the following information.
Name: Installed packages.
Type: R script - Spotfire Enterprise Runtime
for R.
Packages: Leave blank
Description: Report the available packages.
Allow caching: Clear the check box.
Script tab: packages <- installed.packages()
Click the Output parameters tab.
Click Add,
and in the Output Parameter dialog, provide the following information:
Result parameter name: packages.
Display name: Installed packages.
Type: Table.
Description: A table of all of the TERR
and CRAN packages installed; a result of calling the function installed.packages().
On the Register Data Functions dialog toolbar, click Run.
In the Edit Parameters dialog,
select Refresh function automatically.
Comment: You must select this check box, or your analysis displays
only the packages available in your Spotfire Analyst installation.
Click the Output tab, and for the Output handler, click Data table, and then click OK to accept the changes and run the data function.
Click Close, and then click Yes to save the data function to the library on TIBCO Cloud Spotfire.
On the authoring bar, click Visualization types and click Table to create a table visualization displaying all columns of the new Installed packages data table.
Save the analysis to your library folder.
Open the analysis in TIBCO
Cloud Spotfire.
Response: The table displays the available packages.
You can share this analysis with any members of your team who are interested in the available CRAN packages.
See also: