is there anyone, who is working with R and is using java code there? I mean calling Java code from R with "RJAVA" package.
I create my own package and there I have jar file of java code. (like there https://cran.r-project.org/web/packages/helloJavaWorld/vignettes/helloJavaWorld.pdf)
Then I have .r file and I want to call java method. Problem is when I want to return "Java Object of class". There in no problem with "I" as integer or "S" as string. I need Java Object of class in R to continue working with it . It is possible? I found I can return Java Object with return value "L" (e.g."Ljava/lang/Object") but it doesn't work.
This is my R code for calling java code:
FCA <- function(){
a <- .jnew("fcamp/test/MainTest")
b <- .jcall(a, "S", "testFunction")
c <- .jcall(a, "Lfcamp/input/Context;", "testFunction2")
return(c)
}
This is my error:
Error in .jcall(a, "Lfcamp/input/Context;", "testFunction2") :
method testFunction2 with signature ()Lfcamp/input/Context; not found
Where is the mistake ? It is possible return Java Object of class to R and continue to work with it there?