R/UI_warn_badinputs.R

Defines functions warn_oot

# out-of-training data warn
warn_oot <- function(cvals){
  warn <- FALSE
  reason <- ""
  # Western Murray: high regional woody veg estimates high species richness at v low , and high nearby woody vegetation
  if (any(grepl("(Corowa|Narrandera|Tocumwal)", cvals["selected_region"], ignore.case = TRUE)) &&
      cvals[["woody3000m"]] > 10){
    warn <- TRUE
    reason <- paste(reason,
                     "In your geographic region the data used to fit our model contained only one site",
                     "with greater than 10% woody vegetation canopy within 3km.",
                     "Bird estimates here should be treated with additional caution."
                     )
  }
  return(list(
    warn = warn,
    reason = reason
  ))
}
sustainablefarms/farm_biodiversity_app documentation built on Sept. 13, 2023, 9:28 p.m.