/R-codes-for-Extracting-Rainfall

This R script will walk you through the step by step process of extracting the rainfall data from a raster file (.tif) and a shapefile

This R script walks you through the process of extracting the mean daily rainfall for the district of Uganda. This code assumes you have downloaded your rainfall data(raster files) and shapefiles. I downloaded the district shapefile for Uganda from this site "https://data.humdata.org/dataset". Again, I downloaded my daily rainfall data from CHIRPS website "https://data.chc.ucsb.edu/products/CHIRPS-2.0/global_daily/tifs/p05/". Armed with this sets of data, you can change the path to your folders in the R scripts and run. Mind you, this might take sometime. I extracted the daily rainfall for each district for 10 years and it took about 2 hours so be patient.