Data function's TERR script to send commands to open-source R fails with error 'could not find function "REvaluate"'
book
Article ID: KB0080931
calendar_today
Updated On:
Products
Versions
Spotfire Analyst
All supported versions
Spotfire Enterprise Runtime for R
All supported versions
Description
A Spotfire data function's TIBCO Enterprise Runtime for R (TERR) script that sends commands to open-source R fails with error 'could not find function "REvaluate"'.
Issue/Introduction
Data function's TERR script to send commands to open-source R fails with error 'could not find function "REvaluate"'
Environment
All supported environments
Resolution
The REvaluate() function can be used to send data and commands out to an open-source R instance that has been downloaded from the open-source R community's CRAN repository (https://cran.r-project.org/) and installed on the same machine.
The REvaluate() function is part of TERR's optional built-in "RinR" package.
The "RinR" package does not need to be installed in TERR, but it does need to be loaded into the current TERR session's search() path before the script makes any calls to REvaluate().
The following TERR script demonstrates this, using a call to library(RinR) at the top of the script. Inside the call to REvaluate(), it installs, loads and uses the user-contributed "jsonlite" and "curl" packages from the open-source R community's CRAN repository.
## Set the option that will tell REvaluate() where to find open-source R: ## FullPathToOpenSourceR <- "C:/Program Files/R/R-3.4.1/bin/R.exe" options( RinR_R_FULL_PATH = FullPathToOpenSourceR )
## Check to see if the specified path to R exists ## if( ! file.exists(FullPathToOpenSourceR) ) { stop( "A path to open source R must be provided before calling REvaluate() or RGraph()." ) }
The following knowledge base articles also provide examples and information on using the REvaluate() and RGraph() functions from TERR's optional built-in "RinR" package: