Skip to content

PRL-PRG/injectr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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)

## f called with x: 42

## [1] 1764

On exit example

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

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

f(42)

## f called with x: 42 returning: 1764

## [1] 1764

Building

make build

About

R package to inject code to existing functions

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors