This function checks if the situation is a mixture based on the presence of a column named "Dominance" and the uniqueness of its values.

detect_mixture(sim_situation)

Arguments

sim_situation

A data frame containing the simulated data for one situation.

Value

A logical value indicating if the situation is a mixture.

Examples

if (FALSE) { # \dontrun{
sim_data <- data.frame(
  Dominance = c("Principal", "Principal", "Associated", "Associated")
)
CroPlotR:::detect_mixture(sim_data)
# Output: TRUE

sim_data <- data.frame(Dominance = c("Single Crop", "Single Crop"))
CroPlotR:::detect_mixture(sim_data)
# Output: FALSE

sim_data <- data.frame(lai = c(1, 1.2))
CroPlotR:::detect_mixture(sim_data)
# Output: FALSE
} # }