José R. Ferrer-Paris (@jrfep) for UNSW codeRs.
This repository contains code and data used (and re-used) for presentations about geospatial data in R.
Spatial data is essential for understanding many phenomena in natural and social sciences, and maps are used in a variety of fields to visualise data and results in an appealing and interpretive way. I have been dealing with spatial data with (and without) R for nearly 20 years, using a variety of packages and approaches that have evolved over time, regularly finding challenges and new solutions. In this workshop I will show examples of how to work with geospatial data in R, including some basic geospatial analysis, and how current integration of R with external libraries like leaflet make interactive mapping easieR (and niceR!) than ever.
José Rafael Ferrer-Paris (a.k.a. JR) is currently Research Fellow at the Centre for Ecosystem Science at UNSW and the UNSW Data Science Hub, and a member of the International Union for the Conservation of Nature (IUCN) Thematic Group on Red List of Ecosystems. JR has studied and worked in Venezuela, Germany and South Africa with biodiversity data, spatial and temporal ecological data and geographical information systems. He is currently working with Prof. David Keith on global risk assessment of ecosystems and with Prof. Richard Kingsford on tracking ecosystem change to inform ecosystem conservation and management. He has been using R since version 1.0.0, and also likes working with other command, scripting and programming languages like PHP, Bash, Python, JS, Java or Perl and all kinds of databases (SQL, XML, Graphs, etc).
The introduction to the workshop is available in the folder intro-presentation/
And is published in rpubs at: https://rpubs.com/jrfep/geospatial-workshop-intro-12-2023
Title: Geospatial tutorial - intro
Description: Spatial data is essential for understanding many phenomena in natural and social sciences, and maps are used in a variety of fields to visualise data and results in an appealing and interpretive way. In this workshop I will show examples of how to work with geospatial data in R, including some basic geospatial analysis.
Slug: geospatial-workshop-intro-12-2023
For the Workshop I set up the tutorials using the package learnr
. You can run these in your local machine from the workshop folder, but you need to handle all the right version of the packages.
The online versions of these tutorial are available through alternative shinyapp, rpubs, posit cloud or posit connect accounts in the following links:
- Create a spatial object (using
sf
,mapview
)
- Points, lines and polygons (using
sf
,mapview
)
- Thematic mapping (using
sf
,tmap
)
- Geostatistic analysis (using
sf
,sp
,raster
,gstat
)
- Accessing vector and raster data (using
sf
,terra
,leaflet
)
I have done some minor and major changes to this workshop material through time, and you probably want to work on the latest version. But here is a brief account of previous version, if you want to explore them.
This repository was first created for a presentation in ResBaz Sydney 2021 in November 2021.
If you want to visit the old code, you are welcome to do so by navigating the git commit history in GitHub, back to November 28, 2021. There you will find the presentation in folder presentation/intro/ and examples written as plain R scripts in folder presentation/examples/
Content was updated for the UNSW CodeRs Workshop in March 2022, and marked with a GitHub release on the April 2022.
I updated the presentation in presentation/intro/.
I created some tutorials:
- Create a spatial object with
sf
and display withmapview
workshop/tutorial-1/ - Spatial objects and functions in
sf
package and plots withggplot2
in workshop/tutorial-2/
I also added a script with code from the tutorials in examples/Tutorials-script.R
We shared the recording for this workshop through the UNSW codeRs website.