- Updated all CI maps to use tm_scale_continuous() for proper tmap v4 compatibility - Added fixed color scale limits (1-8 for CI, -3 to +3 for differences) for consistent field comparison - Fixed YAML header formatting issues in CI_report_dashboard_planet.Rmd - Positioned RGB map before CI overview map as requested - Removed all obsolete use_breaks parameter references - Enhanced error handling and logging throughout the pipeline - Added new experimental analysis scripts and improvements to mosaic creation
41 lines
1 KiB
R
41 lines
1 KiB
R
# Install required packages for SmartCane project
|
|
# This script installs all packages needed to run the CI report dashboard
|
|
|
|
# List of required packages
|
|
required_packages <- c(
|
|
# Core packages
|
|
"here", "tidyverse", "sf", "terra", "tmap", "lubridate",
|
|
|
|
# Additional data manipulation
|
|
"zoo", "readxl", "knitr", "rmarkdown", "dplyr", "purrr", "stringr",
|
|
|
|
# Spatial analysis
|
|
"exactextractr",
|
|
|
|
# Machine learning and statistics
|
|
"rsample", "caret", "randomForest", "CAST"
|
|
)
|
|
|
|
# Function to install missing packages
|
|
install_if_missing <- function(pkg) {
|
|
if (!requireNamespace(pkg, quietly = TRUE)) {
|
|
message(paste("Installing package:", pkg))
|
|
install.packages(pkg, repos = "https://cloud.r-project.org")
|
|
} else {
|
|
message(paste("Package already installed:", pkg))
|
|
}
|
|
}
|
|
|
|
# Install missing packages
|
|
for (pkg in required_packages) {
|
|
install_if_missing(pkg)
|
|
}
|
|
|
|
# Load core packages to verify installation
|
|
library(here)
|
|
library(tidyverse)
|
|
library(sf)
|
|
library(terra)
|
|
|
|
message("All required packages have been installed!")
|