knitr::opts_chunk$set(echo = TRUE)
devtools::load_all()

injectr

R package for injecting code into existing functions.

Usage

library(injectr)

Look for the documentation of the inject_code.

Examples

On entry example

f <- function(x) {
  x*x
}

inject_code(message("f called with x: ", x), f)

f(42)

On exit example

f <- function(x) {
  x*x
}

inject_code(message("f called with x: ", x, " returning: ", returnValue()), f, "onexit")

f(42)

Building

{sh building, eval=FALSE} make build



PRL-PRG/injectr documentation built on July 7, 2020, 6:44 p.m.