Description Usage Arguments Value Author(s) See Also Examples
Initializes 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.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | BDMethod(x, params = rlang::quos(), post = NULL, meta = NULL, ...)
## S4 method for signature 'quosure'
BDMethod(x, params = rlang::quos(), post = NULL,
meta = NULL, ...)
## S4 method for signature ''function''
BDMethod(x, params = rlang::quos(), post = NULL,
meta = NULL, ...)
## S4 method for signature 'BDMethodList'
BDMethod(x, i = 1)
## S4 method for signature '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
Patrick Kimes
BDMethod-class
, BenchDesign
, BDMethodList
1 2 3 4 5 6 7 8 9 10 11 12 | ## 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")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.