if (requireNamespace("ggplot2", quietly = TRUE)) {
tm <- microbenchmark(rchisq(100, 0),
rchisq(100, 1),
rchisq(100, 2),
rchisq(100, 3),
rchisq(100, 5), times=1000L)
ggplot2::autoplot(tm)
# add a custom title
ggplot2::autoplot(tm) + ggplot2::ggtitle("my timings")
}
Run the code above in your browser using DataLab