R/tbl.R

Defines functions as_tbl.data.frame as_tbl new_tbl

new_tbl <- function(x = list(), n = NULL, ..., class = NULL) {
  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
}
hadley/pillar documentation built on April 26, 2024, 4:19 a.m.