RMethodUtils

0th

Percentile

Method Utilities

Utility functions to support the definition and use of formal methods. Most of these functions will not normally be called directly by the user.

Keywords
internal
Usage
getGeneric(f, mustFind=FALSE, where, package)

getGroup(fdef, recursive, where) getGroupMembers(group, recursive = FALSE, character = TRUE)

getMethodsMetaData(f, where) assignMethodsMetaData (f, value, fdef, where)

makeGeneric(f, fdef, fdefault =, group=list(), valueClass=character(), package =, signature = NULL, genericFunction = NULL, simpleInheritanceOnly = NULL)

makeStandardGeneric(f, fdef)

generic.skeleton(name, fdef, fdefault)

defaultDumpName(generic, signature)

doPrimitiveMethod(name, def, call= sys.call(sys.parent()), ev = sys.frame(sys.parent(2)))

conformMethod(signature, mnames, fnames, f= , fdef, method)

matchSignature(signature, fun, where)

findUnique(what, message, where)

MethodAddCoerce(method, argName, thisClass, methodClass)

cacheMetaData(where, attach = TRUE, searchWhere = as.environment(where), doCheck = TRUE)

cacheGenericsMetaData(f, fdef, attach = TRUE, where, package, methods)

setPrimitiveMethods(f, fdef, code, generic, mlist)

missingArg(symbol, envir = parent.frame(), eval)

sigToEnv(signature, generic)

rematchDefinition(definition, generic, mnames, fnames, signature) unRematchDefinition(definition)

asMethodDefinition(def, signature, sealed = FALSE, fdef)

addNextMethod(method, f, mlist, optional, envir)

insertClassMethods(methods, Class, value, fieldNames, returnAll)

balanceMethodsList(mlist, args, check = TRUE) # <- deprecated since R 3.2.0

See Also

setGeneric, setClass, showMethods.

Aliases
  • asMethodDefinition
  • standardGeneric-class
  • standardGenericWithTrace-class
  • nonstandardGeneric-class
  • nonstandardGenericFunction-class
  • nonstandardGroupGenericFunction-class
  • OptionalFunction-class
  • PossibleMethod-class
  • optionalMethod-class
  • derivedDefaultMethod-class
  • internalDispatchMethod-class
  • substituteFunctionArgs
  • makeGeneric
  • makeStandardGeneric
  • generic.skeleton
  • defaultDumpName
  • doPrimitiveMethod
  • conformMethod
  • getGeneric
  • getGroup
  • getGroupMembers
  • getMethodsMetaData
  • assignMethodsMetaData
  • matchSignature
  • findUnique
  • MethodAddCoerce
  • .saveImage
  • cacheMetaData
  • cacheGenericsMetaData
  • setPrimitiveMethods
  • missingArg
  • balanceMethodsList
  • sigToEnv
  • rematchDefinition
  • unRematchDefinition
  • addNextMethod,MethodDefinition-method
  • addNextMethod,MethodWithNext-method
  • addNextMethod
  • .valueClassTest
  • insertClassMethods
  • .ShortPrimitiveSkeletons
  • .EmptyPrimitiveSkeletons
Examples
library(methods) getGroup("exp") getGroup("==", recursive = TRUE) getGroupMembers("Arith") getGroupMembers("Math") getGroupMembers("Ops") # -> its sub groups
Documentation reproduced from package methods, version 3.3, License: Part of R @VERSION@

Community examples

Looks like there are no examples yet.