This is the repository for my thesis on the Spatial Allocation of Micro Hydropower Sites using Freely Available Datasets The final report of the thesis can be found on researchgate (https://www.researchgate.net/publication/277275863_Spatial_Allocation_of_Micro_Hydropower_Sites_using_Freely_Available_Datasets) In Chapter 2.5 the global structure of the code is explained and in the appendix is the code summarized in pseudo code. The final model can be found in model1c.R and can be started with startupscript1c.R.