Aman Chawla
Aman Chawla

Reputation: 314

Calling R code from java library?

I'm new to statistics, is there any way through which codes written in R statistics software be called from java library. I got some idea about JSC - "Java Statistical Class", but still not finding the way.

I found this under stackexchange: https://stats.stackexchange.com/questions/37466/open-source-java-library-for-statistics-at-the-level-offered-by-a-graduate-stati/60711#60711

Upvotes: 4

Views: 429

Answers (2)

datamole
datamole

Reputation: 155

Probably rJava is the library you need.

The JRI component (formerly an independent project) lets you execute R functions from within Java. You'll have to translate your original R-code to your Java code using JRI's api, but that's reasonably straight-forward and the library performs fast.

You can install rJava from within R or on ubuntu as a package via apt.

I would be careful with the Java Statistical Classes. For me it calculated nonsense in some cases, so better cross-check the results with R should you decide to use that one.

Upvotes: 0

Richi W
Richi W

Reputation: 3656

You can use RCaller I am working on this at the moment and some things work, some don't but it is worth a try.

Upvotes: 2

Related Questions