Skip to content

Instantly share code, notes, and snippets.

@joethorley
Last active January 10, 2017 18:49
Show Gist options
  • Save joethorley/316a27e62bd371b8311f47080af2a7c6 to your computer and use it in GitHub Desktop.
Save joethorley/316a27e62bd371b8311f47080af2a7c6 to your computer and use it in GitHub Desktop.
print when debugging
dprint <- function(x, note = NULL, do = getOption("dprint.do", TRUE)) {
if (!do) return(invisible())
if (!is.null(note))
cat("\n**", note, "**\n")
cat("\n", deparse(substitute(x)), ": \n", sep = "")
print(x)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment