CheapCombFun | R Documentation |
A function to calculate the cheapest drug combination given a data.frame with combination and prices
CheapCombFun(
target,
combi,
total_max = 10,
only_total = TRUE,
vial_share = FALSE
)
target |
The target dose |
combi |
A complete dataframe with combinations and prices |
total_max |
A maximum of possible combinations. Default = 10 |
only_total |
If |
vial_share |
If |
# Data frame of possible doses and prices per dose
df_combi <- data.frame(drug = rep(LETTERS[1], 3),
dose = c(10, 20, 50),
price_dose = c(11.39, 20, 56.96))
# Return only total costs of cheapest option
tatooheen::CheapCombFun(target = 92.5, combi = df_combi, only_total = T)
# Return more information as a list
res <- tatooheen::CheapCombFun(target = 92.5, combi = df_combi, only_total = F)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.