Skip to content

Instantly share code, notes, and snippets.

@joethorley
Last active January 10, 2017 18:49
Show Gist options
  • Select an option

  • Save joethorley/316a27e62bd371b8311f47080af2a7c6 to your computer and use it in GitHub Desktop.

Select an option

Save joethorley/316a27e62bd371b8311f47080af2a7c6 to your computer and use it in GitHub Desktop.

Revisions

  1. joethorley revised this gist Jan 10, 2017. 1 changed file with 3 additions and 2 deletions.
    5 changes: 3 additions & 2 deletions dprint.R
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,8 @@
    dprint <- function(x, note = NULL) {
    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)
    }

  2. joethorley revised this gist Jan 10, 2017. 1 changed file with 5 additions and 2 deletions.
    7 changes: 5 additions & 2 deletions dprint.R
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,7 @@
    dprint <- function(x) {
    dprint <- function(x, note = NULL) {
    if (!is.null(note))
    cat("\n**", note, "**\n")
    cat("\n", deparse(substitute(x)), ": \n", sep = "")
    print(x)
    }
    }

  3. joethorley revised this gist Jan 10, 2017. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions dprint.R
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    dprint <- function(x) {
    cat(deparse(substitute(x)), ": ", sep = "")
    cat("\n", deparse(substitute(x)), ": \n", sep = "")
    print(x)
    }
    }
  4. joethorley revised this gist Jan 10, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion dprint.R
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    dprint <- function(x) {
    print(deparse(substitute(x)))
    cat(deparse(substitute(x)), ": ", sep = "")
    print(x)
    }
  5. joethorley renamed this gist Jan 4, 2017. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  6. joethorley renamed this gist Jan 4, 2017. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  7. joethorley created this gist Jan 4, 2017.
    4 changes: 4 additions & 0 deletions sprint
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,4 @@
    dprint <- function(x) {
    print(deparse(substitute(x)))
    print(x)
    }