简体   繁体   中英

Use SpotfireData package with non-TERR R engine

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

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.

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")

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM