File: getGenericS3.R

package info (click to toggle)
r-cran-r.methodss3 1.8.2-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 300 kB
  • sloc: sh: 12; makefile: 2
file content (40 lines) | stat: -rw-r--r-- 1,071 bytes parent folder | download | duplicates (2)
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
28
29
30
31
32
33
34
35
36
37
38
39
40
###########################################################################/**
# @RdocDefault getGenericS3
#
# @title "Gets an S3 generic function"
#
# \description{
#  @get "title".
# }
#
# @synopsis
#
# \arguments{
#   \item{name}{The name of the generic function.}
#   \item{envir}{The @environment from which the search for the
#     generic @function is done.}
#   \item{inherits}{A @logical specifying whether the enclosing frames
#     should be searched or not.}
#   \item{...}{Not used.}
# }
#
# \seealso{
#   @see "setGenericS3".
#   @see "getMethodS3".
#   @see "isGenericS3".
# }
#
# @author
#
# @keyword programming
# @keyword methods
#*/###########################################################################
setMethodS3("getGenericS3", "default", function(name, envir=parent.frame(), inherits=TRUE, ...) {
  fcn <- .findFunction(name, envir=envir, inherits=inherits)$fcn
  if (is.null(fcn)) {
    stop("No such function found: ", name)
  } else if (!isGenericS3(fcn)) {
    stop("The function found is not an S3 generic function: ", name)
  }
  fcn
})