Simulate Treatment
simulate_treatment.RdThis function simulates treatment data for pathogen processes based on the provided configuration. It generates treatment events and parameters, and can return results in either long or wide format.
Value
If lean is TRUE, returns a list containing only the long-format treatment events.
If wide is TRUE, returns a list containing long-format events, wide-format events,
wide-format scheme events, treatment schemes, and treatment parameters.
If wide is FALSE, returns a list containing long-format events, treatment schemes,
and treatment parameters.
Details
This function does the same thing as kwb.qmra::simulate_treatment(), but it is bundled with ambre to avoid a hard dependency on the unmaintained package.
References
Sonnenberg H (2024). kwb.utils: General Utility Functions Developed at KWB. R package version 0.15.0 URL: https://github.com/kwb-r/kwb.utils (MIT Licence)
Examples
# Example usage of simulate_treatment
# \donttest{
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
result <- simulate_treatment(config, wide = TRUE, debug = FALSE, lean = FALSE)
#> Joining with `by = join_by(TreatmentID)`
#> Joining with `by = join_by(TreatmentID)`
# }