How to plot a graph using R, Java and JRI?

前端 未结 1 1867
感动是毒
感动是毒 2021-02-06 11:07

I am very new to R, so please pardon me if this is a very very basic question.

I have written an R script, which does some calculations and at the end plots Box Plot. If

1条回答
  •  说谎
    说谎 (楼主)
    2021-02-06 11:28

    Here is how I did it: Pastebin link. Basically you need to tell the R package JavaGD that you have a JFrame available where the R plots can be displayed.

    The example in the answer of @John Colby just stores the plot as a file and then displays it in Java - also an option, but a somewhat indirect way to do it.

    (Unfortunately for you my code is in Scala, but as that's quite similar to Java (I translated it from Java), I hope you will be able to translate it back. I used some JRI example as a base for it, and it uses only java classes.)

    0 讨论(0)
提交回复
热议问题