File: helper-foo-tbl.R

package info (click to toggle)
r-cran-pillar 1.8.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,840 kB
  • sloc: sh: 13; makefile: 2
file content (13 lines) | stat: -rw-r--r-- 280 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
new_foo_tbl <- function(..., class = NULL) {
  stopifnot(is.null(class))
  new_tbl(..., class = "foo_tbl")
}

local_foo_tbl <- function(frame = caller_env()) {
  local_methods(
    .frame = frame,
    tbl_sum.foo_tbl = function(x) {
      c(NextMethod(), foo = "bar")
    }
  )
}