Reputation: 7995
I need to execute some R scripts that process timeseries and perform forecast over them. I am using the forecast package and everything works fine when executing the script from R console.
However, I always get the same exception when trying to do the same thing with Renjin: Could not load package org.renjin.cran:colorspace
It seems that there is some dependency missing so I am wondering, if there is some workaround for that.
This is the java/Renjin code (just loading forecast in this example) I am trying to execute:
private void testRenjin() throws ScriptException {
ScriptEngineManager manager = new ScriptEngineManager();
ScriptEngine engine = manager.getEngineByName("Renjin");
// check if the engine has loaded correctly:
if (engine == null) {
log.debug("Error creating Renjin.");
}
engine.eval("library(forecast)");
}
I have set the necessary dependencies in my pom.xml:
<dependency>
<groupId>org.renjin</groupId>
<artifactId>renjin-script-engine</artifactId>
<version>0.7.0-RC7</version>
</dependency>
<dependency>
<groupId>org.renjin.cran</groupId>
<artifactId>forecast</artifactId>
<version>4.04-SNAPSHOT</version>
</dependency>
I would be glad for any help.
Upvotes: 2
Views: 342
Reputation: 1360
The forecast package includes C++ code which is not yet supported by Renjin. (Issue #119)
You can always find the latest updates on package compatability on packages.renjin.org:
http://packages.renjin.org/package/org.renjin.cran/forecast
Upvotes: 1