# initialise list
path <- system.file("testdata", "three3", package = "mm.reoptimise")
scenario <- create_scenario(path)
scenario_list <- list(scenario)
# make a new scenario
myscenario_profit <- set_scenario(scenario_list[[1]],
period = "month",
budget = 3.8e7,
kpi1 = "Profit",
kpi2 = "Profit",
kpi3 = "Profit")
myscenario_profit <- run_optimization(
scenario = myscenario_profit)
# add new scenario to the list
myname <- "my new net profit scenario"
scenario_list <- add_scenario(scenario_list, myscenario_profit, myname)
# test function
test_that("output is correct", {
expect_equal(check_scenario_result_present(scenario_list) %>% length(), length(scenario_list))
expect_equal(check_scenario_result_present(scenario_list), c(F ,T))
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.