R/AllGenerics.R, R/BDMethod-constructor.R, R/BDMethodList-accessors.R, and 2 more
BDMethod.RdInitializes a new BenchDesign method object for benchmarking.
New BDMethod objects are typically not directly constructed as they
have limited use outside of BenchDesign objects. Instead,
methods in a BenchDesign object are more commonly created, modified or
removed using
function calls on the BenchDesign, e.g. using addMethod to
add a new method object.
The constructor can also be used to access BDMethod objects stored in
BDMethodList and BenchDesign objects.
BDMethod(x, params = rlang::quos(), post = NULL, meta = NULL, ...) # S4 method for quosure BDMethod(x, params = rlang::quos(), post = NULL, meta = NULL, ...) # S4 method for `function` BDMethod(x, params = rlang::quos(), post = NULL, meta = NULL, ...) # S4 method for BDMethodList BDMethod(x, i = 1) # S4 method for BenchDesign BDMethod(x, i = 1)
| x | main method function or function quosure. Alternative, may be a
|
|---|---|
| params | list of quosures specifying function parameters.
(default = |
| post | list of functions to be applied to the output of |
| meta | list of metadata. (default = NULL) |
| ... | other parameters. |
| i | integer index or character name of |
BDMethod object
## create a simple BDMethod bdm1 <- BDMethod(x = base::mean) ## create a more complex BDMethod bdm2 <- BDMethod(x = function(x) { x^2 }, post = base::sqrt, meta = list(note = "simple example")) ## construct a BenchDesign with the BDMethod objects bd <- BenchDesign(method1 = bdm1, method2 = bdm2) ## access a BDMethod in the BenchDesign BDMethod(bd, "method1")#> BenchDesign Method (BDMethod) ------------------------------ #> method: base::mean #> function (x, ...) UseMethod("mean") #> parameters: #> none #> post: #> none #> meta: #> none