% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/get_scheme_events_wide.R
\name{get_scheme_events_wide}
\alias{get_scheme_events_wide}
\title{Calculate Wide-Format Treatment Scheme Events}
\usage{
get_scheme_events_wide(config, treatment_events_wide)
}
\arguments{
\item{config}{A configuration object containing treatment scheme information.}

\item{treatment_events_wide}{A data frame in wide format containing treatment events
with columns for each treatment ID and log-reduction values.}
}
\value{
A data frame with columns for event ID, pathogen group, and one column
for each treatment scheme containing the sum of log-reduction values for that scheme.
}
\description{
This function and returns the results in a wide-format data frame.
}
\details{
This function does the same thing as kwb.qmra::get_scheme_events_wide(),
but it is bundled with \emph{ambre} to avoid a hard dependency on the
unmaintained package.
}
\examples{
# Example usage of get_scheme_events_wide
scenario_test <- create_scenario(
  system.file("input_1culture_2pop.xlsx", package = "ambre")
)
scenario_updated <- update_pathogen(scenario = scenario_test,
 pathoName = c("Campylobacter jejuni", "Rotavirus"))
config <- scenario_updated$config[[1]]

# Simulate treatment data
treatment_data <- get_treatment_data(config$treatment$processes, n_repeatings = 5, n_events = 3)

treatment_events_wide <- treatment_data$events |> tidyr::spread(
      key = TreatmentID,
      value = logreduction
    )

# Apply get_scheme_events_wide
scheme_events_wide <- get_scheme_events_wide(config, treatment_events_wide)

# Print results
print(scheme_events_wide)
}
\references{
Sonnenberg H (2024). kwb.utils: General Utility Functions Developed at KWB. R package version 0.15.0
URL: \url{https://github.com/kwb-r/kwb.utils}
(MIT Licence)
}
