## ----include = FALSE----------------------------------------------------------
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  message = FALSE,
  warning = FALSE,
  fig.width = 7,
  fig.height = 4.5,
  out.width = "100%"
)

## ----setup--------------------------------------------------------------------
library(ambre)
set.seed(2024)

## ----families-----------------------------------------------------------------
tn <- sort(unique(config_ambre$treatment$processes$TreatmentName))
head(tn, 15)

## ----input--------------------------------------------------------------------
readxl::read_excel(
  system.file("input_1culture_2pop.xlsx", package = "ambre")
)[, c("STEPtreatmentName", "CollectiveTreatmentName",
      "InitialProcessName", "SupplementaryProcessName")]

## ----compare, results = "hide"------------------------------------------------
library(dplyr)
scenario_example <- create_scenario(filepath = system.file("input_1culture_2pop.xlsx", package = "ambre"))
regulation_reduction <- config_ambre$regulation$regulation_value |> filter(Country == "France") |>
                          select(-c(Concentration, Country, RegulationID))
regulation_concentration <- config_ambre$regulation$regulation_value |> filter(Country == "France") |>
                        select(-c(Country, RegulationID, Reduction))

comparison <- plot_comparison_qmra_initial_vs_supplementary_processes(
  scenario = scenario_example,
  pathogen = c("Campylobacter jejuni"),
  regulationLog = regulation_reduction,
  regulationConcentration = regulation_concentration
)

## ----compare-names------------------------------------------------------------
names(comparison)

## ----compare-logreduction, fig.height = 4-------------------------------------
comparison$log_reduction

## ----compare-dalys, fig.height = 4--------------------------------------------
comparison$dalys

