From 4b862bc016e5414938e496d63d519c08ed193652 Mon Sep 17 00:00:00 2001 From: DimitraVeropoulou Date: Tue, 10 Feb 2026 17:46:28 +0100 Subject: [PATCH 1/3] Issue: two variables were in the same line. --- r_app/80_utils_agronomic_support.R | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/r_app/80_utils_agronomic_support.R b/r_app/80_utils_agronomic_support.R index c8c4fa3..cd16c78 100644 --- a/r_app/80_utils_agronomic_support.R +++ b/r_app/80_utils_agronomic_support.R @@ -369,7 +369,8 @@ calculate_gap_filling_kpi <- function(ci_raster, field_boundaries) { for (i in seq_len(nrow(field_boundaries))) { field_name <- if ("field" %in% names(field_boundaries)) field_boundaries$field[i] else NA_character_ - sub_field_name <- if ("sub_field" %in% names(field_boundaries)) field_boundaries$sub_field[i] else NA_character_ field_vect <- field_boundaries_vect[i] + sub_field_name <- if ("sub_field" %in% names(field_boundaries)) field_boundaries$sub_field[i] else NA_character_ + field_vect <- field_boundaries_vect[i] # Extract CI values using helper function ci_values <- extract_ci_values(ci_raster, field_vect) From cf7d28e2767d212b4b228cf9aa3ef87b43612670 Mon Sep 17 00:00:00 2001 From: DimitraVeropoulou Date: Tue, 10 Feb 2026 17:50:08 +0100 Subject: [PATCH 2/3] added missing bracket and added the total acres var in the reports detail --- r_app/91_CI_report_with_kpis_cane_supply.Rmd | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/r_app/91_CI_report_with_kpis_cane_supply.Rmd b/r_app/91_CI_report_with_kpis_cane_supply.Rmd index 47f68c8..67fa667 100644 --- a/r_app/91_CI_report_with_kpis_cane_supply.Rmd +++ b/r_app/91_CI_report_with_kpis_cane_supply.Rmd @@ -244,6 +244,7 @@ if (!is.null(field_details_file) && file.exists(field_details_file)) { field_details_table <- summary_data$field_analysis %>% rename(`Mean CI` = Mean_CI, `CV Value` = CV, Field = Field_id) safe_log("Extracted field details from field_analysis data")} +} if (kpi_files_exist) { safe_log("✓ KPI summary tables loaded successfully") @@ -391,7 +392,7 @@ if (!is.null(benchmarks)) { **Farm Location:** `r toupper(project_dir)` Estate **Report Period:** Week `r current_week` of `r year` **Report Generated on:** `r format(Sys.time(), "%B %d, %Y at %H:%M")` -**Farm Size Included in Analysis:** +**Farm Size Included in Analysis:** `r toupper(total_acreage)` acres **Data Source:** Planet Labs Satellite Imagery **Analysis Type:** Chlorophyll Index (CI) Monitoring From 8db2b641ceab34749029e19def7d9a693c44dedd Mon Sep 17 00:00:00 2001 From: DimitraVeropoulou Date: Tue, 10 Feb 2026 17:52:15 +0100 Subject: [PATCH 3/3] updated the name of the 90/91 files --- r_app/MANUAL_PIPELINE_RUNNER.R | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/r_app/MANUAL_PIPELINE_RUNNER.R b/r_app/MANUAL_PIPELINE_RUNNER.R index 4850e75..dc60b63 100644 --- a/r_app/MANUAL_PIPELINE_RUNNER.R +++ b/r_app/MANUAL_PIPELINE_RUNNER.R @@ -436,7 +436,7 @@ # From R console or R script: # # rmarkdown::render( -# "r_app/90_CI_report_with_kpis_simple.Rmd", +# "r_app/90_CI_report_with_kpis_agronomic_support.Rmd", # params = list(data_dir = "angata", report_date = as.Date("2026-02-04")), # output_file = "SmartCane_Report_agronomic_angata_2026-02-04.docx", # output_dir = "laravel_app/storage/app/angata/reports" @@ -446,7 +446,7 @@ # From R console or R script: # # rmarkdown::render( -# "r_app/91_CI_report_with_kpis_Angata.Rmd", +# "r_app/91_CI_report_with_kpis_cane_supply.Rmd", # params = list(data_dir = "angata", report_date = as.Date("2026-02-04")), # output_file = "SmartCane_Report_cane_supply_angata_2026-02-04.docx", # output_dir = "laravel_app/storage/app/angata/reports" @@ -492,7 +492,7 @@ # 8. OPTIONAL R91 (Cane Supply) - Use automated runner: # & "C:\Program Files\R\R-4.4.3\bin\x64\Rscript.exe" r_app/run_full_pipeline.R # OR from R console: -# rmarkdown::render("r_app/91_CI_report_with_kpis_Angata.Rmd", +# rmarkdown::render("r_app/91_CI_report_with_kpis_cane_supply.Rmd", # params=list(data_dir="angata", report_date=as.Date("2026-02-04")), # output_file="SmartCane_Report_cane_supply_angata_2026-02-04.docx", # output_dir="laravel_app/storage/app/angata/reports")