Skip to content

Instantly share code, notes, and snippets.

@ramnathv
Last active December 11, 2015 02:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ramnathv/4532561 to your computer and use it in GitHub Desktop.
Save ramnathv/4532561 to your computer and use it in GitHub Desktop.
Wrap Hook Results
#' Wrap output of a function
#'
#' This function can be used to redefine output hooks easily for some important
#' use cases
wrap <- function(fn, before, after){
function(x, ...){
x = paste(c(before, x, after), collapse = '\n')
fn(x, ...)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment