{"id":17111676,"url":"https://github.com/jbytecode/rcaller","last_synced_at":"2025-04-09T22:10:13.436Z","repository":{"id":28663021,"uuid":"32182572","full_name":"jbytecode/rcaller","owner":"jbytecode","description":"A Java library for calling R.","archived":false,"fork":false,"pushed_at":"2025-02-27T11:23:07.000Z","size":3336,"stargazers_count":75,"open_issues_count":4,"forks_count":39,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-04-02T21:06:34.175Z","etag":null,"topics":["java","r"],"latest_commit_sha":null,"homepage":"https://joss.theoj.org/papers/10.21105/joss.02722","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-2.1","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jbytecode.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-03-13T21:49:17.000Z","updated_at":"2025-02-27T11:23:10.000Z","dependencies_parsed_at":"2022-08-24T06:10:42.935Z","dependency_job_id":null,"html_url":"https://github.com/jbytecode/rcaller","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jbytecode%2Frcaller","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jbytecode%2Frcaller/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jbytecode%2Frcaller/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jbytecode%2Frcaller/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jbytecode","download_url":"https://codeload.github.com/jbytecode/rcaller/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248119294,"owners_count":21050755,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["java","r"],"created_at":"2024-10-14T16:56:55.048Z","updated_at":"2025-04-09T22:10:13.417Z","avatar_url":"https://github.com/jbytecode.png","language":"Java","readme":"# Overview\n\n[![Join the chat at https://gitter.im/jbytecode/rcaller](https://badges.gitter.im/jbytecode/rcaller.svg)](https://gitter.im/jbytecode/rcaller?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n[![Build Status](https://github.com/jbytecode/rcaller/workflows/build/badge.svg)](https://github.com/jbytecode/rcaller/workflows/build/badge.svg)\n[![Test Status](https://github.com/jbytecode/rcaller/workflows/test/badge.svg)](https://github.com/jbytecode/rcaller/workflows/test/badge.svg)\n[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.github.jbytecode/RCaller/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.github.jbytecode/RCaller)\n[![status](https://joss.theoj.org/papers/de28eed555632371f4dcbe82efce5075/status.svg)](https://joss.theoj.org/papers/de28eed555632371f4dcbe82efce5075)\n[![DOI](https://zenodo.org/badge/32182572.svg)](https://zenodo.org/badge/latestdoi/32182572)\n\nRCaller is a software library which is developed to simplify calling R from Java. Despite it is not\nthe most efficient way of calling R codes from Java, it is very simple to use and its learning curve is\nsteep. It successfully simplifies and wraps type conversations and makes variables in each languages\naccessible between platforms. With the calling sequential commands facility, the performance is not\nlost through a single external process. Although R is single-threaded, multiple R processes can\nbe created and handled by multiple RCaller instances in Java. A Servlet based application can\ninstantiate many RCaller objects as well as it can use a single object by using sequential command\ninvocation ability. The former use multiple environments which do not share the same variable pool,\nwhereas, the latter shares a mutual variable pool and clients can communicate as well. RCaller is\nwritten purely in Java and it does not depend on any external libraries, that is, it is ready to run in any\nmachines that Java and R installed. Simulation studies show that the other libraries such as Rserve\nand rJava outperform the RCaller by means of interaction times. As a result of this, RCaller is not\nsuitable for the projects which have many clients that request relatively single and small computations.\n[RCaller: A Software Library for Calling R from Java - M. Hakan Satman]\n\n[Official publication](https://doi.org/10.9734/BJMCS/2014/10902)\n\n[Official publication in JOSS](https://joss.theoj.org/papers/10.21105/joss.02722)\n\n[RCaller3 Documentation](https://github.com/jbytecode/rcaller/blob/master/doc/rcaller3/rcaller3.pdf)\n\n\n# Who uses RCaller?\nRCaller is a production ready library for calling R functions from within Java. If you are developing \nJava software that needs enhanced statistical calculations, RCaller is a practical solution to integrate\nthese languages. R has many well-tested and matured packages for automatic time series model selection, \nclustering, segmentation and classification, non-linear and robust regression estimations, data and text\nmining, linear and non-linear programming, generating plots, function optimization besides other research tools.\nRCaller brings all of the functionality that R serves in Java. Easy installation and integration steps and steep learning curve make RCaller a suitable solution.\nRCaller's computation overhead is generating XML files in R side and parsing XML to Java objects in Java side.  \n\n\n# Dependencies\nRCaller compiled jar library requires JRE (v11 or higher) and R installed in the runtime environment.\nIf you want to compile from source, JDK (v11 or higher) and Maven (or Gradle) are also required\nfor building process. Maven is responsible for downloading and install additional Java dependencies\ndefined in [pom file](https://github.com/jbytecode/rcaller/blob/master/RCaller/pom.xml). RCaller\ndoes not use any version specific property of R.\n\n\n# Usage\n\nIt is recommended to take a look at the existing [tests](https://github.com/jbytecode/rcaller/tree/master/RCaller/src/test/java/com/github/rcaller)\n and \n[examples](https://github.com/jbytecode/rcaller/tree/master/RCaller/src/main/java/examples)\n \n\n### Here is a set of selected examples:\n\n- [Basic Graphics](https://github.com/jbytecode/rcaller/blob/master/RCaller/src/main/java/examples/BasicGraphics.java)\n\n- [Basic Script Engine](https://github.com/jbytecode/rcaller/blob/master/RCaller/src/main/java/examples/BasicScriptEngine.java)\n\n- [Descriptive Statistics](https://github.com/jbytecode/rcaller/blob/master/RCaller/src/main/java/examples/DescriptiveStatistics.java)\n\n- [Handling Empty Arrays](https://github.com/jbytecode/rcaller/blob/master/RCaller/src/main/java/examples/EmptyArray.java)\n\n- [Automatic ARIMA Model Selection](https://github.com/jbytecode/rcaller/blob/master/RCaller/src/main/java/examples/Forecasting.java)\n\n- [Graphics with Themes](https://github.com/jbytecode/rcaller/blob/master/RCaller/src/main/java/examples/GraphicsWithThemes.java)\n\n- [Multiple Sequential Calls using a Single R Instance](https://github.com/jbytecode/rcaller/blob/master/RCaller/src/main/java/examples/MultipleCalls.java)\n\n- [Ordinary Least Squares](https://github.com/jbytecode/rcaller/blob/master/RCaller/src/main/java/examples/OrdinaryLeastSquares.java)\n\n- [Swing R GUI](https://github.com/jbytecode/rcaller/blob/master/RCaller/src/main/java/examples/SampleRGui.java)\n\n- [Invoke R Functions](https://github.com/jbytecode/rcaller/blob/master/RCaller/src/main/java/examples/ScriptEngineInvocable.java)\n\n- [Calling R from within Clojure](https://github.com/jbytecode/rcaller/blob/master/markdown/clojure.md)\n\n### Performance details\n\nRCaller uses XML for reading R output by default. This is lightweight but not very fast way.\nFor speeding up the IO, install R [arrow](https://cran.r-project.org/web/packages/arrow/index.html)\npackage and add dependencies\n[org.apache.arrow:arrow-vector](https://search.maven.org/artifact/org.apache.arrow/arrow-vector/5.0.0/jar) and\n[org.apache.arrow:arrow-memory-netty](https://search.maven.org/artifact/org.apache.arrow/arrow-memory-netty/5.0.0/jar) to your Java project.\nRCaller will use Arrow format automatically if it is available both in R and Java.\n\nErrors handling can impact performance in online mode and is disabled by default.\nUse `RCaller.runAndReturnResultOnline(String var, boolean addTryCatch)` method with `addTryCatch = true` for throwing R exceptions to Java.\n  \n# API Docs\n[Here is the auto-generated Javadocs](https://github.com/jbytecode/rcaller/releases/download/RCaller-4.0.2/RCaller-4.0.2-javadoc.jar).\n\n# Building and Installing RCaller\nThere are many options to integrate RCaller with a Java Project. First option is to download pre-compiled jar file and add it to the classpath or pom.xml. [pre-compiled jar files](https://github.com/jbytecode/rcaller/releases) are here.\n\nThe second option is to compile from source. R should be installed to run tests. After building process, if everything is okay, a jar file is located in the target directory.\n\n```BASH\n$ git clone https://github.com/jbytecode/rcaller.git\n$ cd RCaller\n$ mvn package\n```\n\nThe last option is to use maven dependency: \n\n```XML\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.github.jbytecode\u003c/groupId\u003e\n  \u003cartifactId\u003eRCaller\u003c/artifactId\u003e\n  \u003cversion\u003e4.0.2\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nThe RCaller is located in the Maven Central Repository.\n\n# Benchmarks\nYou can test the performance of the library using the benchmark tool hosted [here](https://github.com/jbytecode/rcaller/blob/master/RCaller/src/main/java/benchmark/PassingArraysAndMatrices.java). This file tests costs of passing vectors and matrices from Java to R and vice versa. \n\n# Join us\nIf you want to join us, please follow the community guidelines [here](https://github.com/jbytecode/rcaller/blob/master/CONTRIBUTING.md). We look forward to seeing your contributions.\n\n# Citation\nPlease refer to citation information given in file [bibtex](https://github.com/jbytecode/rcaller/blob/master/bibtex.bib) in your publications.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjbytecode%2Frcaller","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjbytecode%2Frcaller","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjbytecode%2Frcaller/lists"}