0

Is there a way to convert a JSONArray to a R data frame using Java?

We felt it would a better way to convert a JSONArray to a R data frame, rather than writing it to a file/db and then again retrieve it from R.

Any suggestions/recommendations of libraries would be awesome.

0

1 Answer 1

1

First for working with R language in Java project you need to use some JVM-based R interpreter/interface. For instance you can look on next few options:

  • Renjin - JVM-based interpreter for the R language for statistical computing;
  • rJava - R to Java interface;
  • FastR - an implementation of the R Language in Java atop Truffle.

Approach to converting will depend on what tool you choose.

Sign up to request clarification or add additional context in comments.

2 Comments

We use rJava, but are not found a way to convert a JSON to data frame. If there is a way, please let us know...it would be great
I didn't work with rJava unfortunately, and I don't pretty well know R, but I think it will be easier to serialize JSONArray to String JSON and then process it with R approach, something like in this question - stackoverflow.com/questions/16947643/….

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.