how to call Java method which returns any List from R Language?

820 views Asked by At

How to call java method which returns list from R Language.

1

There are 1 answers

3
cyberj0g On BEST ANSWER

You can do it with rJava package.

install.packages('rJava')
library(rJava)
.jinit()
jObj=.jnew("JClass")
result=.jcall(jObj,"[D","method1")

Here, JClass is a Java class that should be in your ClassPath environment variable, method1 is a static method of JClass that returns double[], [D is a JNI notation for a double array. See that blog entry for details.