R/BDMethodList-accessors.R

#' @rdname BDMethod-setter
#' @exportMethod "BDMethod<-"
setReplaceMethod("BDMethod",
                 signature(x = "BDMethodList", i = "character", value = "BDMethod"),
                 function (x, i, value) {
                     x[[i]] <- value
                     x
                 })

#' @rdname BDMethod-setter
#' @exportMethod "BDMethod<-"
setReplaceMethod("BDMethod",
                 signature(x = "BDMethodList", i = "character", value = "NULL"),
                 function (x, i, value) {
                     x[[i]] <- value
                     x
                 })

#' @rdname BDMethod
#' @exportMethod "BDMethod"
setMethod("BDMethod",
          signature(x = "BDMethodList"),
          function(x, i = 1) {
              stopifnot(is(i, "character") || is(i, "numeric"))
              x[[i]]
          })

Try the SummarizedBenchmark package in your browser

Any scripts or data that you put into this service are public.

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