'Scala' < http://www.scala-lang.org/> is embedded in 'R' and callbacks from 'Scala' to 'R' are available. Support is provided to write 'R' packages that access 'Scala'. After installation, please run 'rscala::scalaConfig()'. The vignette provides an update of the original paper
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.
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.7"
A paper describing the software is "conditionally accepted" and "in editing" at the Journal of Statistical Software. The latest 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)
R extensions can be written using this package, as demonstrated by these packages:
3.2.8 (2019-05-11)
3.2.7 (2019-05-11)
3.2.6 (2018-12-15)
3.2.5 (2018-12-07)
3.2.4 (2018-11-05)
3.2.3 (2018-10-22)
3.2.2 (2018-10-17)
3.2.1 (2018-10-12)
3.2.0 (2018-10-04)
3.1.0 (2018-07-12)
3.0.2 (2018-06-29)
+
operator replaces the %@%
operator.*
operator replaces the %~%
and %!%
operators and subsequent
evaluations skip the compilation step. The *
operator is not subject
to Scala REPL's memory leak bug. Within a function, arguments are not
automatically passed.^
operator replaces the %.~%
and %.!%
operators and is
equivalent to the *
operator, except it always returns an rscala
reference.*
and ^
operators, e.g.
s(x=3, y=rnorm(5)) * 'y.map(_+x)'.2.5.3 (2018-04-10)
2.5.2 (2018-04-07)
2.5.1 (2018-02-10)
2.5.0 (2017-11-24)
2.4.0 (2017-09-27)
2.3.5 (2017-08-30)
2.3.4 (2017-08-29)
2.3.3 (2017-08-28)
2.3.2 (2017-08-25)
2.3.1 (2017-08-21)
2.3.0 (2017-08-08)
2.2.2 (2017-05-24)
2.2.1 (2017-05-24)
2.2.0 (2017-05-23)
2.1.1 (2017-05-11)
2.1.0 (2017-05-08)
2.0.1 (2017-04-27)
2.0.0 (2017-04-27)
1.0.15 (2017-02-07)
1.0.14 (2016-11-21)
1.0.13 (2016-07-07)
1.0.12 (2016-06-03)
1.0.11 (2016-05-12)
1.0.10 (2016-05-11)
1.0.9 (2016-03-11)
1.0.8 (2015-12-09)
1.0.7 (2015-12-09)
1.0.6 (2015-05-15)
1.0.5 (2015-05-15)
1.0.4 (2015-03-24)
1.0.3 (2015-03-23)
1.0.2 (2015-03-07)
1.0.1 (2015-03-05)
1.0.0 (2015-03-03)