Search code examples
javarrserve

Accessing the return value in the form of an array of R using RServe on Java


Previously, I was a beginner in the language R. I have a function R which returns an array of double.

Here's a snippet of R code to return that value.

enter image description here

The output of this function is:

enter image description here

Here's a snippet of Java code.

output = connection.eval("neuralNet10()").asDouble();

I want to access the value in Java using RServe. Need help, I would really appreciate if anyone is willing to help thank you.


Solution

  • Don't post pictures of your code, post actual code.

    Everything coming back from Rserve is an array you can access it using .asDoubles() method - note the 's'