knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
library(hermes6) library(tibble) library(magrittr)
Comparisons of speed for different Markov Smoking Probabilistic models.
Functions being tested are. Creates list of functions where the name starts with markov. All top level functions should start with this.
function_names <- ls("package:hermes6", pattern = "markov*") function_names
func_calls <- lapply(function_names, function(func) call(func))
output <- lapply(function_names, function(func) { func_call <- call(func) print(func_call) out <- system.time(eval(func_call)) print(out) out["elapsed"] }) names(output) <- function_names
Benchmarking
output_df <- output %>% unlist(recursive = FALSE) %>% enframe() output_df
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.