で任意のタイプの配列を返すという問題に直面してい.jcall()
ます。これが私のコードです。
public class Test(){
public static double[] sample(){
double[] nobjarr = new double[5]
nobjarr[0] = 1.0;
nobjarr[1] = 1.0;
nobjarr[2] = 1.0;
nobjarr[3] = 1.0;
nobjarr[4] = 1.0;
return nobjarr;
}
}
Rでは、.jcallを使用して呼び出しています
library(rJava)
.jinit()
.jaddClassPath("path to .class file")
objT <- .jnew("Test")
res <- .jcall(objT,"[D","sample")
このため、「Error in .jcall(objT, "[D", "sample") :method sample with signature ()[D not found」というエラーが表示されます