# WARNING - Generated by {fusen} from dev/flat_economic.Rmd: do not edit by hand # nolint: line_length_linter.

#' Total area
#' 
#' Calculate the total area of each culture of the simulated scenario
#' @param scenario data.frame scenario created with create_scenario function
#' @importFrom dplyr select distinct
#' @return surface_total data.frame 
#' 
#' @export
#' @examples
#' scenario_apprentissage <- create_scenario(
#'   system.file("input_1culture_2pop.xlsx", package = "ambre")
#' )
#' total_area_calculation(scenario = scenario_apprentissage)
total_area_calculation <- function(scenario){
  surface_totale_df <- scenario |>  select (CropID, Area) |>  distinct()
  surface_total <- sum(surface_totale_df$Area)
  
  return(surface_total)
    
}
