CheapCombFun: A function to calculate the cheapest drug combination given a...

View source: R/cheapcombfun.R

CheapCombFunR Documentation

A function to calculate the cheapest drug combination given a data.frame with combination and prices

Description

A function to calculate the cheapest drug combination given a data.frame with combination and prices

Usage

CheapCombFun(
  target,
  combi,
  total_max = 10,
  only_total = TRUE,
  vial_share = FALSE
)

Arguments

target

The target dose

combi

A complete dataframe with combinations and prices

total_max

A maximum of possible combinations. Default = 10

only_total

If TRUE, only display the total costs. If FALSE, return all information.

vial_share

If TRUE, vial share is allowed.

Examples

# 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)

fthielen/tatooheen documentation built on Nov. 8, 2023, 4:37 a.m.