inst/doc/Feature-ErrorHandling.R

## ----echo = FALSE, include = FALSE--------------------------------------------
knitr::opts_chunk$set(tidy = FALSE, cache = TRUE, dev = "png",
                      message = FALSE, error = FALSE, warning = TRUE)

## -----------------------------------------------------------------------------
library(SummarizedBenchmark)
library(magrittr)

## -----------------------------------------------------------------------------
bdslow <- BenchDesign(data = tdat) %>%
    addMethod("slowMethod", function() { Sys.sleep(5); rnorm(5) },
              post = list(keepSlow = identity,
                          makeSlower = function(x) { Sys.sleep(5); x })) %>%
    addMethod("fastMethod", function() { rnorm(5) },
              post = list(keepFast = identity,
                          makeSlower = function(x) { Sys.sleep(5); x }))

## ---- message = TRUE----------------------------------------------------------
bpp <- SerialParam()
bptimeout(bpp) <- 1

sbep <- buildBench(bdslow, parallel = TRUE, BPPARAM = bpp)

## -----------------------------------------------------------------------------
sbep

## -----------------------------------------------------------------------------
sapply(assayNames(sbep), assay, x = sbep, simplify = FALSE)

## -----------------------------------------------------------------------------
names(metadata(sbep)$sessions[[1]])

## -----------------------------------------------------------------------------
sess1res <- metadata(sbep)$sessions[[1]]$results
simplify2array(sess1res)

## -----------------------------------------------------------------------------
sess1res$slowMethod$keepSlow

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.