R/utils.R

Defines functions print_method

Documented in print_method

#' @title Determine Printing for colortable
#' @description determines if table is being printed interactively, or in an rmd
#' @return character vector
#' @importFrom knitr opts_knit
#' @export
print_method <- function() {
  is_notebook <- isTRUE(getOption("rstudio.notebook.executing"))
  if (interactive() & !is_notebook) {
    "console"
  } else if (is_notebook) {
    "html"
  } else{
    knitr::opts_knit$get("rmarkdown.pandoc.to")
  }
}
thebioengineer/colortable documentation built on Sept. 2, 2020, 10:35 a.m.