CRAN Version Total Downloads Last Month Downloads Last Week Downloads

Check 🛠 Docs 📚 Code Coverage 📔

GitHub forks GitHub repo stars

GitHub commit activity GitHub contributors GitHub last commit GitHub pull requests GitHub repo size GitHub language count Project Status: Active – The project has reached a stable, usable state and is being actively developed. Current Version Open Issues


teal.code is an R library providing tools to store code and an execution environment associated with it. The features include:

teal.code also ships a shiny module that helps inspect the stored code as well as messages, warnings and error messages resulting from evaluation via shiny web application.


From July 2023 insightsengineering packages are available on r-universe.

# stable versions
install.packages('teal.code', repos = c('https://insightsengineering.r-universe.dev', 'https://cloud.r-project.org'))

# install.packages("pak")

Alternatively, you might also use the development version.

# beta versions
install.packages('teal.code', repos = c('https://pharmaverse.r-universe.dev', 'https://cloud.r-project.org'))

# install.packages("pak")


To understand how to use this package, please refer to the Getting Started article, which provides multiple examples of code implementation.

Below is the showcase of the example usage

my_qenv <- new_qenv(env = list2env(list(x = 5)), code = "x <- 5")
#> Parent: <environment: package:teal.code>
#> Bindings:
#> • x: <dbl> [L]
qenv_2 <- eval_code(my_qenv, "y <- x * 2") |> eval_code("z <- y * 2")
#> <environment: 0x00000135b544cfe8> [L]
#> Parent: <environment: package:teal.code>
#> Bindings:
#> • x: <dbl> [L]
#> • y: <dbl> [L]
#> • z: <dbl> [L]
#> [1] 10
cat(paste(get_code(qenv_2), collapse = "\n"))
#> x <- 5
#> y <- x * 2
#> z <- y * 2

Getting help

If you encounter a bug or you have a feature request - please file an issue. For questions, discussions and staying up to date, please use the “teal” channel in the pharmaverse slack workspace.

Stargazers and Forkers

Stargazers over time

Stargazers over time


Stargazers repo roster for @insightsengineering/teal.code


Forkers repo roster for @insightsengineering/teal.code