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
}

Try the pillar package in your browser

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

pillar documentation built on March 31, 2023, 10:19 p.m.