High-Performance R Implementation
Run your R code faster and more efficiently with GraalVM runtime for R, FastR
Benefits
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
Zero overhead interoperability with other GraalVM languages such as Python or JavaScript.
Compatibility with GNU-R
GraalVM's runtime for R aims to be fully compatible with GNU-R including the interface for native R extensions.
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
Use R seamlessly from Java, Scala or any other JVM language.
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.
Using Java from R
The rJava interoperability graph shows the whole warm-up curve including the peak performance. Lower is better.
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.
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(TRUE)
while (frame$isVisible()) Sys.sleep(1)