R/tbl.R

Defines functions as_tbl.data.frame as_tbl new_tbl

new_tbl <- function(x = list(), n = NULL, ..., class = NULL) {
  check_dots_empty()
  new_data_frame(x, n, class = c(class, "tbl"))
}

as_tbl <- function(x, ...) {
  check_dots_empty()
  UseMethod("as_tbl")
}

#' @export
as_tbl.data.frame <- function(x, ...) {
  class(x) <- c("tbl", "data.frame")
  x
}

Try the pillar package in your browser

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

pillar documentation built on July 29, 2021, 9:06 a.m.