inst/doc/benchmark.R

## ---- include = FALSE---------------------------------------------------------
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)

## ----setup--------------------------------------------------------------------
library(chunkhooks)
hook_benchmark()

## ----bench1, benchmark=TRUE---------------------------------------------------
# benchmark=TRUE is specified as a chunk option
sum(seq(100))

## -----------------------------------------------------------------------------
hook_benchmark(format = function(x, options) as.character(x))

## ----bench2, benchmark=TRUE---------------------------------------------------
sum(seq(100))

Try the chunkhooks package in your browser

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

chunkhooks documentation built on Aug. 5, 2020, 5:09 p.m.