Skip to content

UNSW-codeRs/geospatial-data-in-R

Repository files navigation

geospatial-data-in-R

License: CC BY 4.0

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.

Abstract

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.

Bio

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).

Content of this repo

Presentations

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

Tutorials

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:

  1. Create a spatial object (using sf, mapview)
  1. Points, lines and polygons (using sf, mapview)
  1. Thematic mapping (using sf, tmap)
  1. Geostatistic analysis (using sf, sp, raster, gstat)
  1. Accessing vector and raster data (using sf, terra, leaflet)

Going back in time

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:

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.