knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "README-" )
The goal of mbc is to make comparisons between different code expressions. It builds on the R package microbenchmark, adding a comparison of the output provided by each expression in addition to the comparison of run time as given by microbenchmark.
You can install mbc from github with:
# install.packages("devtools") devtools::install_github("CollinErickson/mbc")
This is a basic example which shows you how to solve a common problem. It creates random samples of 100 exponential data points and finds the mean or median. The results show that the mean is 4 times faster (since it doesn't have to sort the values) and that the mean is around 1 while the median is around 0.71.
## basic example code mbc::mbc(mean(rexp(100)), median(rexp(100)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.