嗨,我是 R 语言和 renjin 的新手。在我的项目中,以下是添加的 Maven 依赖项。
<dependency>
<groupId>org.renjin.cran</groupId>
<artifactId>rgeos</artifactId>
<version>0.3-2-b24</version>
</dependency>
我已经添加了上述依赖项。我也尝试了不同和最新版本的 rgeos 依赖项。
我在代码中将 rgeos 包作为 engine.eval("library(rgeos)"); 在java中加载这个包时,我遇到了错误
org.renjin.eval.EvalException: IOException while loading package org.renjin.cran:rgeos: Could not resolve native method 'rgeos_Init' in package 'rgeos'
at org.renjin.primitives.packaging.NamespaceRegistry.tryLoad(NamespaceRegistry.java:215)
at org.renjin.primitives.packaging.NamespaceRegistry.tryGetNamespace(NamespaceRegistry.java:168)
at org.renjin.primitives.packaging.NamespaceRegistry.getNamespace(NamespaceRegistry.java:130)
at org.renjin.primitives.packaging.NamespaceRegistry.getNamespace(NamespaceRegistry.java:98)
at org.renjin.primitives.packaging.Packages.library(Packages.java:40)
at org.renjin.primitives.R$primitive$library.doApply(R$primitive$library.java:73)
at org.renjin.primitives.R$primitive$library.apply(R$primitive$library.java:34)
at org.renjin.primitives.special.InternalFunction.apply(InternalFunction.java:45)
at org.renjin.eval.Context.evaluateCall(Context.java:407)
at org.renjin.eval.Context.evaluate(Context.java:282)
at org.renjin.eval.Context.evaluate(Context.java:264)
at org.renjin.primitives.special.BeginFunction.apply(BeginFunction.java:38)
at org.renjin.eval.Context.evaluateCall(Context.java:407)
at org.renjin.eval.Context.evaluate(Context.java:282)
at org.renjin.eval.Context.evaluate(Context.java:264)
at org.renjin.eval.Context.evaluate(Context.java:198)
at org.renjin.sexp.Closure.doApply(Closure.java:98)
at org.renjin.eval.ClosureDispatcher.apply(ClosureDispatcher.java:80)
at org.renjin.eval.ClosureDispatcher.applyClosure(ClosureDispatcher.java:51)
at org.renjin.sexp.Closure.apply(Closure.java:83)
at org.renjin.eval.Context.evaluateCall(Context.java:407)
at org.renjin.eval.Context.evaluate(Context.java:282)
at org.renjin.eval.Context.evaluate(Context.java:264)
at org.renjin.eval.Context.evaluateExpressionVector(Context.java:390)
at org.renjin.eval.Context.evaluate(Context.java:280)
at org.renjin.eval.Context.evaluate(Context.java:264)
at org.renjin.script.RenjinScriptEngine.eval(RenjinScriptEngine.java:168)
at org.renjin.script.RenjinScriptEngine.eval(RenjinScriptEngine.java:127)
at com.nact.Test.main(Test.java:21)
Caused by: org.renjin.eval.EvalException: Could not resolve native method 'rgeos_Init' in package 'rgeos'
at org.renjin.primitives.Native.findMethodByName(Native.java:572)
at org.renjin.primitives.Native.findMethod(Native.java:545)
at org.renjin.primitives.Native.redotCall(Native.java:364)
at org.renjin.primitives.R$primitive$$Call.apply(R$primitive$$Call.java:62)
at org.renjin.eval.Context.evaluateCall(Context.java:407)
at org.renjin.eval.Context.evaluate(Context.java:282)
at org.renjin.eval.Context.evaluate(Context.java:264)
at org.renjin.primitives.special.BeginFunction.apply(BeginFunction.java:38)
at org.renjin.eval.Context.evaluateCall(Context.java:407)
at org.renjin.eval.Context.evaluate(Context.java:282)
at org.renjin.eval.Context.evaluate(Context.java:264)
at org.renjin.eval.Context.evaluate(Context.java:198)
at org.renjin.sexp.Closure.doApply(Closure.java:98)
at org.renjin.eval.ClosureDispatcher.apply(ClosureDispatcher.java:80)
at org.renjin.eval.ClosureDispatcher.applyClosure(ClosureDispatcher.java:51)
at org.renjin.sexp.Closure.apply(Closure.java:83)
at org.renjin.eval.Context.evaluateCall(Context.java:407)
at org.renjin.eval.Context.evaluate(Context.java:282)
at org.renjin.sexp.Promise.doEval(Promise.java:92)
at org.renjin.sexp.Promise.force(Promise.java:86)
at org.renjin.eval.Context.evaluateSymbol(Context.java:345)
at org.renjin.eval.Context.evaluate(Context.java:278)
at org.renjin.sexp.Promise.doEval(Promise.java:92)
at org.renjin.sexp.Promise.force(Promise.java:86)
at org.renjin.eval.Context.evaluateSymbol(Context.java:345)
at org.renjin.eval.Context.evaluate(Context.java:278)
at org.renjin.eval.Context.evaluate(Context.java:264)
at org.renjin.invoke.codegen.ArgumentIterator.evalNext(ArgumentIterator.java:70)
at org.renjin.primitives.R$primitive$assign.apply(R$primitive$assign.java:30)
at org.renjin.primitives.special.InternalFunction.apply(InternalFunction.java:45)
at org.renjin.eval.Context.evaluateCall(Context.java:407)
at org.renjin.eval.Context.evaluate(Context.java:282)
at org.renjin.eval.Context.evaluate(Context.java:264)
at org.renjin.eval.Context.evaluate(Context.java:198)
at org.renjin.sexp.Closure.doApply(Closure.java:98)
at org.renjin.eval.ClosureDispatcher.apply(ClosureDispatcher.java:80)
at org.renjin.eval.ClosureDispatcher.applyClosure(ClosureDispatcher.java:51)
at org.renjin.sexp.Closure.apply(Closure.java:83)
at org.renjin.eval.Context.evaluateCall(Context.java:407)
at org.renjin.eval.Context.evaluate(Context.java:282)
at org.renjin.eval.Context.evaluate(Context.java:264)
at org.renjin.primitives.special.BeginFunction.apply(BeginFunction.java:38)
at org.renjin.eval.Context.evaluateCall(Context.java:407)
at org.renjin.eval.Context.evaluate(Context.java:282)
at org.renjin.eval.Context.evaluate(Context.java:264)
at org.renjin.eval.Context.evaluate(Context.java:198)
at org.renjin.sexp.Closure.doApply(Closure.java:98)
at org.renjin.eval.ClosureDispatcher.apply(ClosureDispatcher.java:80)
at org.renjin.eval.ClosureDispatcher.applyClosure(ClosureDispatcher.java:51)
at org.renjin.sexp.Closure.apply(Closure.java:83)
at org.renjin.eval.Context.evaluateCall(Context.java:407)
at org.renjin.eval.Context.evaluate(Context.java:282)
at org.renjin.eval.Context.evaluate(Context.java:264)
at org.renjin.primitives.special.BeginFunction.apply(BeginFunction.java:38)
at org.renjin.eval.Context.evaluateCall(Context.java:407)
at org.renjin.eval.Context.evaluate(Context.java:282)
at org.renjin.eval.Context.evaluate(Context.java:264)
at org.renjin.eval.Context.evaluate(Context.java:198)
at org.renjin.sexp.Closure.doApply(Closure.java:98)
at org.renjin.eval.ClosureDispatcher.apply(ClosureDispatcher.java:80)
at org.renjin.eval.ClosureDispatcher.applyClosure(ClosureDispatcher.java:51)
at org.renjin.sexp.Closure.apply(Closure.java:83)
at org.renjin.eval.Context.evaluateCall(Context.java:407)
at org.renjin.eval.Context.evaluate(Context.java:282)
at org.renjin.eval.Context.evaluate(Context.java:264)
at org.renjin.primitives.packaging.NamespaceRegistry.tryLoad(NamespaceRegistry.java:198)
... 28 more