Desktop and Enterprise Software, Solutions and Services for Chemists and Biologists.

Enterprise Support » FAQ


Question:

How to export data from Spotfire to use with TERR in RStudio.

 

Answer:


When you execute a data function in Spotfire, the data is exported into SBDF format. TIBCO Enterprise Runtime for R (TERR) contains a function (in its optional built-in "SpotfireData" package) called importDataFromSBDF(), which will import data from SBDF files. The advantage of using this method to transfer the data to RStudio is that it is using the same export method that is used when a data function is called in Spotfire. This will ensure that the data types and column names will match exactly when running a data function in Spotfire.

Resolution

Use the following steps:

In Spotfire:

1) Export the data table to file using the SBDF format by selecting File -> Export -> Data to File -> Data table.

2) Select the data table to export from the drop down list shown.

3) Click OK.

4) Select a location to save to, enter a file name, and set Save as type: to "TIBCO Spotfire Binary Data Format (*.sbdf)" .

5) Click Save.

In RStudio with the TERR engine selected:

1) Run the following code to load the dataset:

library( SpotfireData )

myData <- importDataFromSBDF( "C:/path/to/myfile.sbdf" )

The data is now available in RStudio, using the object name "myData".

Note: in this example, "C:/path/to/myfile.sbdf" represents the path and name of the file you selected in step 4 of the Spotfire export steps, above.

Reference

To view the help file in TERR, first load the package using this command:

library( SpotfireData )

then run the following command:

?importDataFromSBDF



Created on: 7/13/2017
<< Back << Return to support home