You can create a data function for a Spotfire analysis that
displays a table of all packages installed and available to the
R engine running in your
Spotfire Service for R.
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
-
Open any analysis.
-
From the menu, click
.
The
Register Data Functions dialog box is displayed.
-
Provide a name, such as
Installed Packages.
-
From the
Type drop-down list box, select
R script - Open Source R.
-
Clear the
Allow caching check box
-
In the
Script text box, type the following function.
packages <- installed.packages()
-
Click the
Output Parameters tab, and then click
Add.
The
Output Parameter dialog box is displayed.
-
For
Result parameter name, type
packages.
-
Provide a
Display name, such as
Installed Packages.
-
From the
Type drop-down list box, select
Table.
-
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.)
-
Click the
Output tab, and for the
Output handler, select
Data table.
-
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
Spotfire Service for R on this server.