[R] API request from R
Robert Baer
rbaer at atsu.edu
Thu Feb 19 21:11:01 CET 2015
On 2/19/2015 8:06 AM, Barry Rowlingson wrote:
> On Wed, Feb 18, 2015 at 11:44 AM, Mittal Ashra via R-help
> <r-help at r-project.org> wrote:
>> Dear All,
>> Apologies for mailing it to the whole crowd. This is Mittal, presently working in a Project where we have build a platform for displaying recommendations and the results are based on the statistical models.
>> I have gone through the CRAN repository to look out for an package which converts the R code into an JAVA API and that can be called from the platform. However, did not find any. If anyone can guide me to the right package that will be grateful.
>> The packages can be similar to DeployR from Revolution Analytics.
> I doubt there's anything smart enough to take a set of R functions
> and magically create all the necessary Java boilerplate code that
> constitutes an implementation of an API in Java (cynics would say Java
> was all boilerplate...).
>
> There's the rJava package, which includes the JRI system for calling
> R from Java. Then your java can kick off an R "engine" and do R stuff:
I thought rJava called java from R not the other way around.
Description: Low-level interface to Java VM very much like .C/.Call and friends. Allows creation of objects, calling methods and accessing fields.
>
> [boilerplate code deleted]
>
> Rengine re=new Rengine(args, false, new TextConsole());
>
> [more deleted boilerplate]
>
> re.eval("data(iris)",false);
>
> What you would have to do would be to write the Java
> functions/methods/classes with the appropriate arguments for your API
> and make them call the R code this way.
>
> I think RCaller is another way of doing this from Java - its not on
> CRAN since its not an R package, its a Java library.
>
> Barry
>
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
--
Robert W. Baer, Ph.D.
Professor of Physiology
Kirksville College of Osteopathic Medicine
A T Still University of Health Sciences
800 W. Jefferson St
Kirksville, MO 63501
rbaer(at)atsu.edu
[[alternative HTML version deleted]]
More information about the R-help
mailing list