tests/testthat/helper-tbl-sum.R

as_override_tbl_sum <- function(x) {
  structure(x, class = c("override_tbl_sum", class(x)))
}

local_override_tbl_sum <- function(frame = caller_env()) {
  local_methods(
    .frame = frame,
    tbl_sum.override_tbl_sum = function(x) {
      c(NextMethod(), "Overridden" = "tbl_sum")
    }
  )
}

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.