TERR Errors with tidyr Package

  • Have you had problems with TERR since the rollout of TERR 4.4 in Spotfire 7.11?
  • Are you running into compatibility problems between package versions?
  • Would you like to be able to remove the default package installation and install a specific version of a package?
  • Are you getting the error — Error in .BuiltIn(“on.exit”) : the S language function ‘on.exit’ is not stored as a variable value, and can only be accessed by evaluating source expressions containing ‘on.exit’ statements — when trying to use the tidyr R package?

The Problem

Last week, a user reached out to me after TERR threw errors when trying to use the fill() function in the tidyr R package. Here is the error…

Error in .BuiltIn(“on.exit”) : the S language function ‘on.exit’ is not stored as a variable value, and can only be accessed by evaluating source expressions containing ‘on.exit’ statements

My company upgraded to 7.12 about 2 months ago.  The user noted this data function worked before the upgrade but had not worked since the upgrade.

Background

In version 7.11, TIBCO upgraded the TERR engine from 4.3 to 4.4 as noted on their Community page. We have experienced a lot of issues with TERR since upgrading to Spotfire  7.12.  (Note, we went straight from Spotfire 7.9 to 7.12).  One of the changes in TERR 4.4 is that by default, TERR now installs the most recent version of the available package.  You can see the version number in the TERR Tools menu (Tools — TERR Tools — Package Management tab), and while this sounds like a good idea, it isn’t always.

Because I’ve experienced multiple TERR problems since the upgrade, I didn’t try to troubleshoot this one myself.  I went straight to TIBCO support.  Here is their response.

TIBCO Response

I am able to reproduce the given error using tidyr package in TERR 4.4. Later I found that there is already a defect submitted for TERR 4.4 in our database. This is a known package/TERR compatibility issue that was introduced (by the CRAN package’s author) in a recent version of the user-contributed “tidyr” package from the open-source R community’s CRAN repository. A fix is planned in TERR 4.5 which is currently in QC testing and not released yet. The reason why you did not see this issue before upgrade to 7.12 is, earlier Spotfire version you had ( that is v7.9 if I am correct) had TERR 4.3 version bundled. TERR 4.3 installs older version of “tidyr” package (version 0.6.3) from our TRAN repository for other package-compatibility reasons. In TERR 4.4 , it installs new version (0.8.1) of this package from CRAN which has TERR compatibility issue using given use case.

TIBCO Support

Now, the response made it sound like the package author created the problem.  In a subsequent response, the tech said this was a TIBCO defect.

Due to defect at our end for tidyr package in TERR 4.4 , as a workaround we used older package from TRAN. If you come across any issues while using any other packages in TERR 4.4 , please report a new case and we will verify by reproducing the given scenario at our end and then suggest workaround/solution.TIBCO Support

The Solution

Thus, the solution is to manually uninstall  version 0.8.1 and install the older version 0.6.3. Now, I am going to show you how to do that.

Step 1 — To begin, go to the TIBCO website to download the older version.

Step 2 — Next, go to Tools -> TERR Tools -> Package Management OR Tools -> Launch TERR Console to confirm the package version that is installed currently.

Run the command packageVersion(“tidyr”) to see the package version. NOTE: I took this screenshot after I installed the old version.  You should see version 0.8.1 (or a higher version).

Step 3 — Then, run the command .libPaths() to return the file path to the package folders.

Step 4 — Navigate thru the user named (ex. jsebby) file path until you find one folder per package.  Rename the existing tidyr folder.  I renamed mine with the version number.  Unzip, copy and paste the package folder downloaded from the TIBCO site in step 1.  Save it here.

Step 5 — When you rerun step 2 executing the packageVersion command, and it should say the older version — 0.6.3.

As mentioned above, this is a TIBCO defect that will be remedied in TERR 4.5.  No information was provided on release versions or dates.  I strongly encourage you to reach out to TIBCO support or the TIBCO community if you run into TERR errors.

Spotfire Version

Content created with Spotfire 7.12.

 

 

 

 

Guest Spotfire blogger residing in Whitefish, MT.  Working for SM Energy’s Advanced Analytics and Emerging Technology team!

Leave a Comment

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