% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/create_scenario_from_df.R
\name{create_scenario_from_df}
\alias{create_scenario_from_df}
\title{Create Exposure Scenario from a data.frame}
\usage{
create_scenario_from_df(user_input, config = config_ambre)
}
\arguments{
\item{user_input}{A data.frame / tibble with columns \code{CropName}, \code{Area},
\code{PopulationName}, \code{nb_population}, \code{PathName}, \code{nb_day_decay}, and the four
treatment columns \code{STEPtreatmentName}, \code{CollectiveTreatmentName},
\code{InitialProcessName}, \code{SupplementaryProcessName}. Each treatment cell may be
a single name, a character vector of names, \code{NA}, or empty.}

\item{config}{list config file, default value \code{config_ambre}.}
}
\value{
A scenario tibble, same structure as \code{\link[=create_scenario]{create_scenario()}}.
}
\description{
Like \code{\link[=create_scenario]{create_scenario()}} but takes an in-memory \code{data.frame} instead of an
Excel file, and each of the four treatment roles
(STEP / Collective / Initial / Supplementary) may hold a \emph{vector} of process
names (a list-column), so a train can contain more than one process per role.
}
\details{
Single-value role columns are also accepted (they behave like
\code{\link[=create_scenario]{create_scenario()}}); \code{NA} / empty roles are dropped from the train.
}
\examples{
df <- data.frame(
  CropName = "Tomato", Area = 35,
  PopulationName = "Maintenance staff", nb_population = 1,
  PathName = "Consumption of the final product tomato",
  nb_day_decay = NA_real_
)
df$STEPtreatmentName <- list(c("Q.1 - Activated Sludge", "Q.2 - Maturation Pond"))
df$CollectiveTreatmentName <- list(NA_character_)
df$InitialProcessName <- list("Q.6 - Chlorination")
df$SupplementaryProcessName <- list(NA_character_)
create_scenario_from_df(df)
}
