File: table.R

package info (click to toggle)
r-bioc-biocgenerics 0.52.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 772 kB
  • sloc: makefile: 2
file content (27 lines) | stat: -rw-r--r-- 1,055 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
### =========================================================================
### The table() generic
### -------------------------------------------------------------------------

### base::table() has a broken signature (list.names() is a function
### defined *inside* the body of base::table() so the default value for the
### 'dnn' arg is an expression that cannot be evaluated *outside* the
### base::table environment, this is poor design), we cannot keep all the
### extra arguments in the table() generic (those extra arguments are ugly
### and nobody uses them anyway).
#setGeneric("table", signature="...",
#    function(..., exclude = if (useNA == "no") c(NA, NaN),
#                  useNA = c("no", "ifany", "always"),
#                  dnn = list.names(...),
#                  deparse.level = 1)
#        standardGeneric("table")
#)

### So we use this instead.

.table.useAsDefault <- function(...) base::table(...)

setGeneric("table", signature="...",
    function(...) standardGeneric("table"),
    useAsDefault=.table.useAsDefault
)