diff --git a/r_app/CI_report_dashboard_planet.Rmd b/r_app/CI_report_dashboard_planet.Rmd index 3a4f482..b6aa7d9 100644 --- a/r_app/CI_report_dashboard_planet.Rmd +++ b/r_app/CI_report_dashboard_planet.Rmd @@ -286,6 +286,10 @@ CI_quadrant <- readRDS(here(cumulative_CI_vals_dir,"All_pivots_Cumulative_CI_qu group_by(model) %>% # Group by model or other relevant columns fill(field, sub_field, .direction = "downup") %>% # Fill down then up within each group ungroup() +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) @@ -343,6 +347,10 @@ pred_rf_current_season <- prepare_predictions(predict(model_ffs_rf, newdata = pr ``` ```{r yield_plaatjes, echo=FALSE } +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 +} ggplot(pred_ffs_rf, aes(y = predicted_Tcha, x = tonnage_ha)) + geom_point(size = 2, alpha = 0.6) + # Adjust point size and transparency geom_abline(intercept = 0, slope = 1, linetype = "dashed", color = "red") + # Reference line diff --git a/r_app/Rplots.pdf b/r_app/Rplots.pdf index b361f10..1541128 100644 Binary files a/r_app/Rplots.pdf and b/r_app/Rplots.pdf differ