getArgumentDefaults {latrend} | R Documentation |
Default argument values for the given method specification
Description
Returns the default arguments associated with the respective lcMethod
subclass.
These arguments are automatically included into the lcMethod
object during initialization.
Usage
getArgumentDefaults(object, ...)
## S4 method for signature 'lcMethod'
getArgumentDefaults(object)
Arguments
object |
The method specification object. |
... |
Not used. |
Value
A named list
of argument values.
Implementation
Although implementing this method is optional, it prevents users from having to specify all arguments every time they want to create a method specification.
In this example, most of the default arguments are defined as arguments of the function
lcMethodExample
, which we can include in the list by calling formals. Copying the arguments from functions
is especially useful when your method implementation is based on an existing function.
setMethod("getArgumentDefaults", "lcMethodExample", function(object) { list( formals(lcMethodExample), formals(funFEM::funFEM), extra = Value ~ 1, tol = 1e-4, callNextMethod() ) })
It is recommended to add callNextMethod()
to the end of the list.
This enables inheriting the default arguments from superclasses.
See Also
Other lcMethod implementations:
getArgumentExclusions()
,
lcMethod-class
,
lcMethodAkmedoids
,
lcMethodCrimCV
,
lcMethodDtwclust
,
lcMethodFeature
,
lcMethodFunFEM
,
lcMethodFunction
,
lcMethodGCKM
,
lcMethodKML
,
lcMethodLMKM
,
lcMethodLcmmGBTM
,
lcMethodLcmmGMM
,
lcMethodMclustLLPA
,
lcMethodMixAK_GLMM
,
lcMethodMixtoolsGMM
,
lcMethodMixtoolsNPRM
,
lcMethodRandom
,
lcMethodStratify