Blog

Using TERR in RStudio

facebooktwittergoogle_plusredditpinterestlinkedinmail

Daniel-Smith
Daniel Smith, MBA CPA CMA
Principal Consultant

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)\TIBCO\Spotfire\[SPOTFIRE VERSION]\Modules\TIBCO Enterprise Runtime for R_[TERR VERSION]\engine\bin

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 …\TIBCO\Spotfire\[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!

Download TERR Ebook
facebooktwittergoogle_plusredditpinterestlinkedinmail

3 Comments

  1. Lou Bajuk-Yorgan

    Hi Daniel

    Just wanted to let your readers know that Steps 2 & 3 will be replaced with something much easier in Spotfire 7.0, available soon. In the latest release, users can simply click on the new “TERR Tools” menu item, click “Copy TERR Engine Path to Clipboard”, and they will have the right path, ready to paste into their RStudio configuration.

    Regards
    Lou

  2. Marcus Eby

    I haven’t been able to get RStudio to work with TERR. Did you have any issues on your install?

    1. Daniel Smith

      Marcus,
      It is likely that there is a hidden folder issue. Make sure you can see the folder “modules” in your local Spotfire directory.
      Which version of Spotfire are you using? With Spotfire 7.0 you have the option to open RStudio directly from Spotfire with the TERR engine already running.
      Hope this helps! Let us know if you have any other questions!

Leave a Comment

Your email address will not be published. Required fields are marked *

 

Login

Register | Lost your password?