This is an R Shiny application that integrates with Google Earth Engine (GEE) using RGEE for data visualization and analysis of landscape restoration impacts in Kenya. The app allows users to monitor changes in Net Primary Productivity (NPP) and Land Surface Temperature (LST) over time, and identify potential areas for future restoration efforts.
Below is an example of the dashboard interface developed for monitoring restoration impacts:
Before running the application, ensure you have the following:
- R 4.4.3 or higher installed.
- An active Google Earth Engine account (sign up at https://signup.earthengine.google.com/).
- Python installed on your system (preferably via Anaconda).
- RStudio for running the R code.
Start by installing the necessary R packages in your RStudio environment. Open a terminal or RStudio and run the following commands:
# Install R packages
install.packages(c("rgee", "dplyr", "ggplot2", "lubridate", "stringr", "shiny", "shinydashboard", "leaflet", "sf", "geojsonio"))Create a new Conda environment to manage your Python dependencies for Google Earth Engine.
- Open the Anaconda Prompt (or your terminal if Anaconda is installed).
- Run the following command to create a new environment named
gee:
conda create -n gee python=3.8- Activate the environment:
conda activate gee- Install the Google Earth Engine API within the
geeenvironment:
pip install earthengine-api==0.1.317- Inside RStudio, within the
global.Rfile, activate the Conda environment using reticulate:
library(reticulate)
use_condaenv("gee")
# Load other required libraries
library(rgee)
library(dplyr)
library(ggplot2)
library(lubridate)
library(stringr)
library(shiny)
library(shinydashboard)
library(leaflet)
library(sf)- Once the environment is active, run the GEE initialization:
ee_Initialize()- This will redirect you to a Google login page. Sign in with your Google Earth Engine account.
- After signing in, copy the authorization token provided.
- Paste the token into the R console when prompted to verify your authentication.
After successful authentication:
- The app will automatically start on http://127.0.0.1:5167. It may take up to 10 minutes to load.
- Be patient as the app initializes and starts loading the data.
Once loaded, the dashboard provides:
- Interactive maps showing restored areas, reference zones, and potential restoration sites.
- Time-series graphs comparing NPP and LST between restored and non-restored zones.
Example of NPP and LST time-series analysis during short rains:
Map showing bare ground frequency (2015–2024):
Potential restoration areas identified via Random Forest modeling:
- Authentication Error: Ensure you’ve successfully authenticated and pasted the token into the R console.
- Long Load Time: The app may take several minutes to initialize due to large dataset processing.
- FAO. (2018). WaPOR Database Methodology: Level 2. Rome: FAO.
- R Spatial. (2025). rgee: R Bindings for Google Earth Engine. GitHub.
- Chang, W., et al. (2024). Shiny: Web Application Framework for R.



