R/formatted.R

Defines functions pak_preformat print.pak_preformatted format.pak_preformatted

#' @export

format.pak_preformatted <- function(x, ...) {
  attr(x, "pak_preformatted")
}

#' @export

print.pak_preformatted <- function(x, ...) {
  cat(format(x, ...), sep = "\n")
}

pak_preformat <- function(x, ...) {
  attr(x, "pak_preformatted") <- format(x, ...)
  class(x) <- c("pak_preformatted", class(x))
  x
}

Try the pak package in your browser

Any scripts or data that you put into this service are public.

pak documentation built on May 29, 2024, 10:35 a.m.