knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
nrc aims to be an R version of 9cc: R compiler written in R.
You can install nrc from github with:
# install.packages("remotes") remotes::install_github("igjit/nrc")
Note: currently nrc only works on Linux.
Try in Docker:
$ docker run --rm -it rocker/tidyverse:3.6.2 R -q > remotes::install_github("igjit/nrc")
library(nrc) compile("1 + 2") compile("1 + 2") %>% assemble() %>% execute() compile("a <- 2; a * 3") %>% assemble() %>% execute() compile("add2 <- function(x) x + 2; add2(40)") %>% assemble() %>% execute()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.