R includes several functions that can be used for reading, visualizing, and analyzing spatial data. Moreover, the contribution of the open source software community makes R such an extremely powerful analysis and visualization tool for spatial data. CRAN Task View - Analysis of Spatial Data lists and describes many of those contributed packages. At the time of writing the website listed around 180 contributed packages related to spatial data analysis. In the subsequent sections we will mostly deal with the following packages:

Please be aware that the methods we apply in the subsequent sections may be implemented in other packages as well. Depending on your particular application it might be useful to look out for other packages as well.


The E-Learning project SOGA-R was developed at the Department of Earth Sciences by Kai Hartmann, Joachim Krois and Annette Rudolph. You can reach us via mail by soga[at]zedat.fu-berlin.de.

Creative Commons License
You may use this project freely under the Creative Commons Attribution-ShareAlike 4.0 International License.

Please cite as follow: Hartmann, K., Krois, J., Rudolph, A. (2023): Statistics and Geodata Analysis using R (SOGA-R). Department of Earth Sciences, Freie Universitaet Berlin.