When you execute a data function in Spotfire, the data is exported into TIBCO's Spotfire Binary Data Format (SBDF). 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 an RStudio instance that uses TERR 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.
================================
IMPORTANT NOTE: The method used in this article is only available for use with TIBCO Enterprise Runtime for R. It is not available for use with open-source R. This is true because (by design) TIBCO's proprietary "SpotfireData" package for TERR is not available for use with open-source R.
================================
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".
Comments
0 comments
Article is closed for comments.