1

I want to read in Spotfire Binary data into a non-TERR R engine that can handle graphing and other complex packages, etc. So I want to use the SpotfireData package with other non-TERR R engines. Yet when I try to install, I get an error:

install.packages("SpotfireData")
Warning in install.packages :
  package ‘SpotfireData’ is not available (for R version 3.4.4)

Has anyone had luck using the SpotfireData package outside of TERR?

I'm using:

> version
               _                           
platform       x86_64-w64-mingw32          
arch           x86_64                      
os             mingw32                     
system         x86_64, mingw32             
status                                     
major          3                           
minor          4.4                         
year           2018                        
month          03                          
day            15                          
svn rev        74408                       
language       R                           
version.string R version 3.4.4 (2018-03-15)
nickname       Someone to Lean On 

Also, when I switch engines to R3.4.3, I get the same error:

 install.packages("SpotfireData")
Warning in install.packages :
  package ‘SpotfireData’ is not available (for R version 3.4.3)

Also, when I copy/paste the actual SpotfireData package folder into my R3.4.4 library, I get this error:

library(SpotfireData)
Error in library(SpotfireData) : 
  ‘SpotfireData’ is not a valid installed package
user2554330
  • 37,248
  • 4
  • 43
  • 90
shwan
  • 538
  • 6
  • 21
  • The "not available" messages just tell you it's not in the repositories you're searching (CRAN, ...?) You'll probably need to get a source copy of it (i.e. a `tar.gz` file, if it is open source) and install from that. – user2554330 Mar 20 '18 at 19:03

2 Answers2

0

I'm not aware of an easy way to do this - TIBCO don't publish the packages to a repository that I know of.

If you have Spotfire Statistics Services you can find the binary packages under the installation directory - in the 'update\R\src\contrib' folder. Copy the SpotfireData_<ver>.tar.gz file to your machine and then install directly from that file. I've personally used this approach.

To install the library from the file use the 'install.packages' command with the filename, similar to below:

install.packages("c:/users/xxxxxx/Downloads/SpotfireData_9.12.0-63.tar.gz",repos=NULL)

You will also need to have the Rtools installed so it can compile the package from source - check on cran.r-project.org and download the appropriate Rtools for your version.

  • Thanks Peter...in trying your second solution, I've copied the unzipped TERR package into my R library folder, but when I try to library() the package by name, R doesn't find it. find.package() gives the path, but require() fails: "SpotfireData" is not a valid package... – shwan Apr 27 '18 at 19:20
  • OK - I tested like yourself and find that copying the TERR version doesn't work because they're not binary compatible. The other method does work - copying from the R installation on a Spotfire Statistics Services server, but that's no use to you if you haven't got the server... – Pete Thompson May 02 '18 at 14:20
  • Hey Peter, thanks again for the feedback. So I got my IT guy to send me the tar.gz file...but I'm not clear on how to install directly from that file...I extracted it to the ...\R\R-3.5.0\library, but when I try to use library(SpotfireData), I get the following error: Error in library(SpotfireData): ‘SpotfireData’ is not a valid installed package – shwan May 02 '18 at 18:46
  • Hi, sorry it took a while to answer. I've updated the answer to add some instructions on installing the file. – Pete Thompson May 18 '18 at 13:26
  • No problem Pete - I really appreciate the help...I'm going to give you an answer here anyway, but now I'm getting this problem: – shwan May 18 '18 at 16:48
  • ********************************************** WARNING: this package has a configure script It probably needs manual configuration ********************************************** ** libs Warning in system(cmd) : 'make' not found ERROR: compilation failed for package 'SpotfireData' * removing 'C:/Users/sconroy/Documents/R/R-3.5.0/library/SpotfireData' In R CMD INSTALL Warning in install.packages : installation of package ‘C:/Users/sconroy/Downloads/SpotfireData_9.12.0-63.tar.gz’ had non-zero exit status – shwan May 18 '18 at 16:48
  • You need the Rtools so that you can build packages from source. You can find the download on cran.r-project.org, pick the one that matches your R version. – Pete Thompson May 18 '18 at 20:40
0

An alternative method is to write a simple data function that Spotfire calls using TERR to save the data from Spotfire into R format and then read that file into R.

Lots more info here: https://community.tibco.com/wiki/tips-debugging-tibco-enterprise-runtime-r-scripts-tibco-spotfire-dataexpression-functions

Here's the important part from that page:

To do this, add a line of code to the top of the R script to save the input parameters to an RData file:

save(list=ls(), file="C:/debug.RData", RFormat=TRUE) Then, in RStudio or the TERR console, load the RData file and run the R script so that the exact same inputs are used as when the R script ran in the TERR data function.

load(file="C:/debug.RData")