This commit is contained in:
Timon 2025-04-22 17:43:11 +02:00
parent 29e2867b41
commit fbc8f5e11b
2 changed files with 1301 additions and 172 deletions

File diff suppressed because one or more lines are too long

View file

@ -281,6 +281,12 @@ group_by(model) %>% # Group by model or other relevant columns
fill(field, sub_field, .direction = "downup") %>% # Fill down then up within each group fill(field, sub_field, .direction = "downup") %>% # Fill down then up within each group
ungroup() ungroup()
# Check if tonnage_ha is empty
if (all(is.na(CI_quadrant$tonnage_ha))) {
log_message("Lacking historic harvest data, please provide for yield prediction calculation")
knitr::knit_exit() # Exit the chunk if tonnage_ha is empty
}
harvesting_data <- harvesting_data %>% rename(season = year) harvesting_data <- harvesting_data %>% rename(season = year)
CI_and_yield <- left_join(CI_quadrant , harvesting_data, by = c("field", "sub_field", "season")) %>% #filter(!is.na(tonnage_ha)) %>% CI_and_yield <- left_join(CI_quadrant , harvesting_data, by = c("field", "sub_field", "season")) %>% #filter(!is.na(tonnage_ha)) %>%