How to make developing TERR in Spotfire less painful

In a previous article I mentioned using RStudio as a development environment for Spotfire TERR (TIBCO Enterprise Runtime for R).

For those of you using Spotfire and not using TERR, it’s an incredibly powerful feature you really need to add to your toolbox. It effectively gives you the ability to use every type of analytical function and data manipulation process ever developed. From Latent Factor Clustering to scripted ETL – it pretty much does it all. However, trying to develop code inside the Spotfire TERR console can be a bit of a pain.

Why? Because you have to click through three menus to execute the code, then if there is an error, you have to parse through Spotfire and TERR’s errors to find the cause.

Therefore, it makes sense to develop in an IDE (such as RStudio) then copy paste your code into Spotfire.

“But RStudio uses R not TERR, so you can’t do that!” Actually, you can! But it requires a few not so obvious steps. Let me show you how:

Step One: Download RStudio

If you don’t have it already, RStudio is the best development environment for R, so you should get it even if you’re not using TERR. (Why are you reading this article by the way?)

Plus the Open Source version is completely free so you have no excuse. Get it here.

There’s a whole bunch of little configuration tricks we can discuss, but that’s for another article.

Step Two: Show hidden folders

Spotfire by default hides the folder containing the TERR engine, so to find it, you have to make it stop hiding. To accomplish that you have to “Show Hidden Folders.”

Here’s how you do it on Windows 7.

Here’s how to for Windows 8.

Step Three: Find your TERR Engine

Now assuming you have successfully installed RStudio and you have Spotfire installed on your local machine (Again, why are you reading this if you don’t have Spotfire?) you can locate the application Spotfire uses to process R code – The TIBCO Enterprise Runtime for R engine.

It is typically located in C:Program Files (x86)TIBCOSpotfire[SPOTFIRE VERSION]ModulesTIBCO Enterprise Runtime for R_[TERR VERSION]enginebin

With [SPOTFIRE VERSION] as the version of Spotfire installed on your computer and [TERR VERSION] the TERR version you are currently running.

If you can find the directory …TIBCOSpotfire[SPOTFIRE VERSION] but you can’t find “Modules” That directory is still hidden, stop skipping steps, go back to step number two and try again.

Step Four: Point RStudio to your TERR Engine

RStudio defaults to a local instance of R. You probably installed it when you installed RStudio. But we need to point RStudio to TERR not R.

We verified the location of TERR in step three, so now we need to tell RStudio where to find TERR.

1. In RStudio go to Tools > Global Options…

Syntelli tutorial
2. In the General menu, click Change… to change your R version:

Syntelli tutorial
3. TERR Typically does not show up by default, so we’ll need to click “Browse…”

Syntelli TERR tutorial
4. Navigate to the “TIBCO Enterprise Runtime for R_[TERR VERSION]engine” folder on the path to the TERR engine

Syntelli TERR tutorial
5. Take your pick of either 32 or 64 bit TERR (There isn’t much difference)

Syntelli TERR tutorial
6. Make sure TERR is selected in the “Choose R Installation” Window, click “OK”, and you are ready to go! (After you restart RStudio for the changes to take effect…)

Syntelli TERR tutorial

Step Five: Verify TERR is running in RStudio

When RStudio restarts, take a look at the console. It will tell you what version of R, or in this case TERR, is running. If you see “TIBCO Enterprise Runtime for R..” then you are successfully running TERR in RStudio! Yay!

Syntelli TERR tutorial

Learn even more about TERR by getting our latest Ebook!

[maxbutton id=”8″ ]