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


HealthEconomicsHackathon/hermes6 documentation built on April 8, 2020, 1:47 p.m.