modifyMethod: Modify method in BenchDesign object

Description Usage Arguments Value Author(s) See Also Examples

View source: R/modifyMethod.R

Description

Takes a BenchDesign object, the name of an existing method, and new parameter specifications, and returns a modified BenchDesign object with the specified changes.

Usage

1
modifyMethod(bd, label, params, .overwrite = FALSE)

Arguments

bd

BenchDesign object.

label

Character name of method to be modified.

params

Named quosure list created using quos of parameter = value paiars to replace in the method definition. The post, and meta parameters of the method can be modified using the special keywords, bd.post, and bd.meta (the prefix denoting that these values should modify BenchDesign parameters). All other named parameters will be added to the list of parameters to be passed to func.

.overwrite

Logical whether to overwrite the complete existing list of parameters to be passed to func (TRUE), or to simply add the new parameters to the existing list and only replace overlapping parameters (FALSE). (default = FALSE)

Value

Modified BenchDesign object with single method parameters modified.

Author(s)

Patrick Kimes

See Also

addMethod, expandMethod, dropMethod

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
## empty BenchDesign
bench <- BenchDesign()

## add method
bench <- addMethod(bench, label = "qv",
                   func = qvalue::qvalue,
                   post = function(x) { x$qvalue },
                   meta = list(note = "storey's q-value"),
                   params = rlang::quos(p = pval))

## modify method 'meta' property of 'qv' method
bench <- modifyMethod(bench, label = "qv",
                      params = rlang::quos(bd.meta =
                           list(note = "Storey's q-value")))

## verify that method has been updated
printMethod(bench, "qv")

SummarizedBenchmark documentation built on Nov. 8, 2020, 8:30 p.m.