Learn R Programming

⚠️There's a newer version (3.2.25) of this package.Take me there.

rscala: Bridge Between 'R' and 'Scala' with Callbacks

By David B. Dahl (Brigham Young University)

The rscala package provides a bridge between R and Scala, enabling a user to exploit each language's respective strengths in a single project. The rscala package brings Scala and Java libraries into R with a simple interface. Specifically, Scala classes can be instantiated and methods of Scala classes can be called directly. Furthermore, arbitrary Scala code can be executed on the fly from within R and callbacks to R are supported. Conversely, rscala also enables arbitrary R code to be embedded within a Scala application.

Installation

In R, install the package by executing:

install.packages("rscala") 

To install --- or check the compatability of your existing installation of --- Scala and Java, please execute:

rscala::scalaConfig()

Note that if only want to embed R in a Scala application, you don't need to install the package. Simply add the following line to the your SBT build.sbt file:

libraryDependencies += "org.ddahl" %% "rscala" % "3.2.18"

Usage guides

The original paper describing the software is:

D. B. Dahl (2020), Integration of R and Scala using rscala, Journal of Statistical Software, 92:4, 1-18, doi:10.18637/jss.v092.i04.

The citation information is available using:

citation("rscala")

An updated version of the paper is available here or as a vignette in R (once the package is installed):

vignette("rscala")

The functionality of the software is also described and demonstrated in the help files:

library(help="rscala")
library(rscala)
example(scala)

Example packages built with rscala

R extensions can be written using this package, as demonstrated by these packages:

Resources

Copy Link

Version

Install

install.packages('rscala')

Monthly Downloads

99

Version

3.2.18

License

Apache License 2.0 | file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

David B Dahl

Last Published

February 17th, 2020

Functions in rscala (3.2.18)

+.rscalaBridge

Declaration Operator
scalaMemory

Get or Set Memory Available to Scala
is.scalaReference

Test for Scala Reference
scalaLazy

Lazily Execute Functions on a Scala Bridge
scalaFindBridge

Find a Scala Bridge
close.rscalaBridge

Close a Scala Bridge
scalaDisconnect

Temporarily Disconnect Scala by Closing Connections
^.rscalaBridge

Evaluation Operator Returning a Reference and Transcompile Operator
scalaDevelDeployJARs

Deploy JAR Files into the Package File System
scalaConfig

Configure Scala and Java
scala

Instantiate a Scala Bridge
scalaVersionJARs

JAR Files for Support Scala Versions
scalaJARs

Add JAR Files to Classpath
scalaDevelDownloadJARs

Download and Deploy JAR Files into the Package File System
scalaLast

Retrieve the Last Scala Computation
scalaType

Get or Specify a Scala Type
scalaSBT

Run SBT and Deploy JAR Files
*.rscalaBridge

Evaluation Operator
scalaPull

Push and Pull Objects Between R and Scala
scalaPushRegister

Register Functions to Push and Pull Between R and Scala