Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
73 lines (41 sloc) 1.6 KB

Using Renjin as an R Package

.. index::
   single: REPL

Though Renjin's ultimate goal is to be a complete, drop-in replacement for GNU R, in some cases you may want to run only part of your existing R code with Renjin, from within GNU R.

For this use case, you can load Renjin as a package and evaluate performance-sensitive sections of your code, without having to rewrite the R code.


You must have Java 8 installed or higher. For best performance, we recommend using the latest version of Oracle or OpenJDK 8. The rJava package is also required, but should be installed automatically.


On the latest version of GNU R (≥ 3.4), you can install the latest version of the package from Renjin's secure repository:


Older versions of GNU R may not support secure (https) URLs on your platform, or may not support installing directly from URLs. In this case, you can run:

download.file("", "renjin.tgz")
install.packages("renjin.tgz", repos = NULL, type = "source")



bigsum <- function(n) {
  sum <- 0
  for(i in seq(from = 1, to = n)) {
    sum <- sum + i
bigsumc <- compiler::cmpfun(bigsum) # GNU R's byte code compiler