teal.code

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

Overview

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.

Installation

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")
pak::pak("insightsengineering/teal.code@*release")

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")
pak::pak("insightsengineering/teal.code")

Usage

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

library(teal.code)
my_qenv <- new_qenv(env = list2env(list(x = 5)), code = "x <- 5")
my_qenv
#> Parent: <environment: package:teal.code>
#> Bindings:
#> • x: <dbl> [L]
qenv_2 <- eval_code(my_qenv, "y <- x * 2") |> eval_code("z <- y * 2")
qenv_2
#> <environment: 0x00000135b544cfe8> [L]
#> Parent: <environment: package:teal.code>
#> Bindings:
#> • x: <dbl> [L]
#> • y: <dbl> [L]
#> • z: <dbl> [L]
qenv_2[["y"]]
#> [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

Stargazers repo roster for @insightsengineering/teal.code

Forkers

Forkers repo roster for @insightsengineering/teal.code