Troubleshooting TERR and Spotfire Packages
If you remove a package accidentally, cannot install a package, get different results than you expect in your analysis, or cannot distribute an SPK, try these techniques to solve the problem.
I generated a new
SPK using
writeLines
but it is not being distributed.
It is most likely that the SPK version number is not being properly revised. Review the rules for how the SPK version is determined in SpotfireSPK versioning for more information.
I have copied a package from CRAN but it is not working with TERR
Always make sure to use the version of open-source R that was tested with the version of TERR you are using.
- To install a binary package
from a repository, always call
install.packages(pkgname)
from TERR. Theinstall.packages
function finds the correct binary version in the repository for your version of TERR. Manually downloading the binary package from CRAN can result in errors when you use it with TERR. - To install a package from
source, try installing it first with TERR (with
install.packages
in TERR or withTERR CMD INSTALL
from a command line). - To install a package from source that you cannot build with TERR, install the package with the version of open-source R tested with TERR.
I accidentally removed a package from my Spotfire installation that I need. How do I get it back?
We recommend never removing a package from Spotfire TERR Tools, unless you have downloaded and installed the package yourself from a repository. You must be very careful to not remove a package that is installed with TERR or distributed by the Spotfire Server using the SPK mechanism. However, should you accidentally remove a needed package, you can recover.
If you deleted a distributed package, follow these steps.- Open Windows Explorer and
browse to
%SPOTFIRE_HOME%\Modules.
For example, C:\Program Files (x86)\Spotfire\<version#>\Modules.
- Delete the folder Spotfire Enterprise Runtime for R Packages_<version#> .
- Restart Spotfire and accept the prompt to update your installation.
All of the TERR packages contained in the SPK on the Spotfire Server are redistributed.
If you deleted a package required by TERR to operate, follow these steps.
- Open Windows Explorer and
browse to
%SPOTFIRE_HOME%\Modules.
For example, C:\Program Files (x86)\Spotfire\<version#>\Modules.
- Delete the folder Spotfire Enterprise Runtime for R_<version#> .
- Restart Spotfire and accept the prompt to update your installation.
The package containing TERR is redistributed.
I am generating a different result from those seen by others. What could cause this?
Check your package version numbers to make sure everyone is using the same package version. See your package curator for more information.
I am trying to use a package on Spotfire Statistics Services but it's not working.
Be aware that by default, certain functions are restricted by Spotfire Statistics Services. If you see the error "Error: restricted call to Native[tempfile]", and execution of the expression is terminated, then the default restrictions have not been changed by your server administrator. Restricted behavior includes the following non-exhaustive list of operations.
- Performing any I/O to the file system or the internet.
- Loading new packages, except for the libraries included with TERR (for example, stats).
- Spawning new OS processes
(calling
system
). - Calling
.Call
, which is used to call Rapi code in CRAN packages. - Calling
.C
or.Fortran
. - Calling into Java using the terrJava package (which allows executing arbitrary Java methods).
- Calling any functions in the parallel package (which uses terrJava).
- Accessing any function
environments in the stack above the call to
evalREX
usingsys.frame
orparent.frame
. (This prevents malicious code from installing functions or expressions that could be executed after leaving restricted execution mode.) - Changing the variable
lookup path by setting
parent.env
of an environment, or reading or setting the environment of a closure. - Defining S4 classes and
methods using
setClass
orsetMethod
.
Be sure you are loading the package in your
TERR
script. Although the package is on
Spotfire Statistics Services,
it is not loaded into the engine. With each call to
Spotfire Statistics Services,
the engine is started anew. To use the package, you can either load the library
as part of your function scripts, or you can include it in the
Packages
field of your data function.
I cannot install a package from TRAN on Linux because it requires another package that is not installing correctly.
Some packages customized and placed on TRAN require other packages not available on TRAN. Some of these packages cannot be installed using the
TERR function
install.packages
, so the TRAN package cannot be successfully installed. If you encounter this situation, try building and installing the package using open-source R.
If you get a warning that the rinclude package is not installed, try installing that package from TRAN and trying again.
options()$repos
to install from only
TRAN
before reinstalling the package. See
Specifying an
older package on TRAN for more information.