High-Performance R Implementation

Run your R code faster and more efficiently with GraalVM runtime for R, FastR

Benefits

running code faster icon

Running R Code Faster

GraalVM's runtime for R is the fastest at running scalars in R. Now you do not have to rewrite R in C++ for performance.
interoperability icon

Interoperability

Zero overhead interoperability with other GraalVM languages such as Python or JavaScript.
compatibility icon

Compatibility with GNU-R

GraalVM's runtime for R aims to be fully compatible with GNU-R including the interface for native R extensions.
fastR cluster package icon

FastRCluster Package

GraalVM's R runtime is compatible with the PSOCK interface and can be used as a worker node from GNU-R.
java embedding pacman icon

Java Embedding

Use R seamlessly from Java, Scala or any other JVM language.
blazing fast rJava icon

Blazing Fast rJava

rJava implementation provided by GraalVM's R implementation is orders of magnitudes faster than GNU-R.

Faster R with FastR

FastR Speedup over GNU-R

Raytracing algorithm using pure R version and R plus Fortran version. Higher is better.
fastR metrics, raytracing algorithm

Using Java from R

The rJava interoperability graph shows the whole warm-up curve including the peak performance. Lower is better.
fastR metrics, the rJava interoperability graph
fastR quote icon

Embedding R code in a Scala/JVM project with GraalVM can be an excellent way to use the powerful data processing packages accessible in R while using a language more suitable for integration in a services landscape.

Nathan Perdijk photo
Nathan Perdijk
Scala Developer at Codestar

Try Examples

# Java interop: create image and register graphics
imageClass <- java.type('java.awt.image.BufferedImage')
image <- new(imageClass, 500, 600, imageClass$TYPE_INT_RGB);
graphics <- image$getGraphics()
graphics$setBackground(java.type('java.awt.Color')$white);
grDevices:::awt(500, 550, graphics)

# Draw image of clusters in the iris dataset using R library
library(lattice)
iris$cluster <- factor(kmeans(iris[, c('Sepal.Width', 'Petal.Length')],5)$cluster);
print(xyplot(Sepal.Width ~ Petal.Length, data=iris, groups=cluster, pch=20, cex=3));

# Java interop: open a window with image
imageIcon <- new("javax.swing.ImageIcon", image)
label <- new("javax.swing.JLabel", imageIcon)
panel <- new("javax.swing.JPanel")
panel$add(label)
frame <- new("javax.swing.JFrame")
frame$setMinimumSize(new("java.awt.Dimension", image$getWidth(), image$getHeight()))
frame$add(panel)
frame$setVisible(T)
while (frame$isVisible()) Sys.sleep(1)
application opens a Java window

R's graphical output in a Java-based desktop application

Making a Difference for Real-World Applications

FastRCluster: running FastR from GNU-R

The goal of FastRCluster is to provide the intermediate ground and let the GNU-R users easily try FastR and/or use FastR to run only selected parts of their apps. FastRCluster is an R package, targeted at GNU-R, that provides a seamless way to run FastR inside GNU-R using the existing interface of the parallel package, which also integrates well with the future and promise packages. The talk will also present how FastRCluster can be leveraged in the context of Shiny applications.

Compatible with GNU-R

Learn more about GraalVM FastR's compatibility with GNU-R and high performance R code execution in article on Medium.

Try GraalVM for Your R Applications

The R logo is © 2016 The R Foundation

Connect with us