Takes a BenchDesign
object, the name of an
existing method, and new parameter specifications,
and returns a modified BenchDesign
object with new methods added. The named method is "expanded" to mutliple methods
according to the specified set of parameters.
expandMethod(bd, label, params, onlyone = NULL, .replace = FALSE, .overwrite = FALSE)
bd |
|
---|---|
label | Character name of method to be expanded. |
params | Named list of quosure lists specifying the label of the
new methods to be added to the |
onlyone | Character name of a parameter to be modified. Only specify
if just a single parameter should be replaced in the original
method definition. Ignored if |
.replace | Logical whether original |
.overwrite | Logical whether to overwrite the existing list of
parameters ( |
Modified BenchDesign
object with new methods with
specified parameters added.
## empty BenchDesign bench <- BenchDesign() ## add basic 'padjust' method bench <- addMethod(bench, label = "padjust", func = p.adjust, params = rlang::quos(p = pval, method = "none")) ## modify multiple parameters - params is a list of quosure lists newparams <- list(bonf = rlang::quos(p = round(pval, 5), method = "bonferonni"), bh = rlang::quos(p = round(pval, 3), method = "BH")) bench_exp <- expandMethod(bench, label = "padjust", params = newparams) BDMethodList(bench_exp)#> BenchDesign Method List (BDMethodList) --------------------- #> list of 3 methods #> method: padjust; func: p.adjust #> method: bonf; func: p.adjust #> method: bh; func: p.adjust## only modify a single parameter - params is a quosure list newparams <- rlang::quos(bonf = "bonferonni", BH = "BH") bench_exp <- expandMethod(bench, label = "padjust", onlyone = "method", params = newparams) BDMethodList(bench_exp)#> BenchDesign Method List (BDMethodList) --------------------- #> list of 3 methods #> method: padjust; func: p.adjust #> method: bonf; func: p.adjust #> method: BH; func: p.adjust