# 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.

## About this task

Perform this task in an instance of Spotfire Analyst, and then save the resulting analysis to the Spotfire library on the server.

## Procedure

1. Open any analysis.
2. From the menu, click Tools > Register Data Functions.
   The Register Data Functions dialog box is displayed.
3. Provide a name, such as `Installed Packages`.
4. From the Type drop-down list box, select R script - Open Source R.
5. Clear the Allow caching check box
6. In the Script text box, type the following function.
   `packages <- installed.packages()`
7. Click the Output Parameters tab, and then click Add.
   The Output Parameter dialog box is displayed.
8. For Result parameter name, type `packages`.
9. Provide a Display name, such as `Installed Packages`.
10. From the Type drop-down list box, select Table.
11. Run the function, and in the resulting Edit Parameters dialog box, select the Refresh function automatically check box, and optionally, specify whether you want the function to always run in a separate engine session. (For more information about the option Always run in separate session, see "Configuring Data Function Parameters" in the Spotfire® User's Guide.)
12. In the Run location drop down list box, select Force Server.
13. Click the Output tab, and for the Output handler, select Data table.
14. Click OK and then save the data function to the library on the server.

## Results

When you open the analysis from the library, the resulting table reports all of the packages currently available to the TERR service on this server.