This repository contains the materials for D-Lab R Geospatial Fundamentals workshop. We recommend attending R Fundamentals, R Data Wrangling, and R Data Visualization prior to this workshop.
Check D-Lab's Learning Pathways to figure out which of our workshops to take!
In this 2-part workshop series, we will provide an introduction to spatial analyses in R. We discuss the benefits of the additional ‘location’ component that defines spatial data and how spatial dataframes organize this information. Using the sf
(simple features) and terra
packages in R, we will navigate fundamental operations for reading, writing, manipulating, and visualizing spatial data.
This workshop aims to equip participants with the fundamentals needed to conduct spatial analyses for their various endeavors.
After this workshop, you will be able to:
Part 1
- Understand different types of spatial data (points, lines, polygons).
- Use appropriate coordinate reference systems.
- Employ visualization techniques (overlay plotting, interactive maps).
Part 2
- Implement classification schemes (equal intervals, quantiles and natural breaks) for improved data visualization.
- Conduct spatial measurement queries (distance from, intersections, buffers, and finding nearest features).
This workshop does not cover the following:
- Basic commands R. This is covered in R Fundamentals.
- Working with dataframes in R. This is covered in R Data Wrangling.
- Basic data visualization in R. This is covered in R Data Visualization.
We will use [RStudio/Python] to go through the workshop materials, which requires installation of [Software]. Complete the following steps:
- This step(s) details software to download, with a link.
- Download these workshop materials:
- Click the green "Code" button in the top right of the repository information.
- Click "Download Zip".
- Extract this file to a folder on your computer where you can easily access it (we recommend Desktop).
- Optional: if you’re familiar with git, you can instead clone this repository by opening a terminal and entering [GitCloneCommand].
If you do not have R installed and the materials loaded on your workshop by the time it starts, we strongly recommend using the UC Berkeley DataHub to run the materials for these lessons. You can access the DataHub by clicking the following button:
Some users may have to click the link twice if the materials do not load initially.
The DataHub downloads this repository, along with any necessary packages, and allows you to run the materials in an RStudio instance on UC Berkeley's servers. No installation is needed from your end - you only need an internet browser and a CalNet ID to log in. By using the DataHub, you can save your work and come back to it at any time. When you want to return to your saved work, go straight to DataHub, sign in, and click on the R-Fundamentals
folder.
If you don't have a Berkeley CalNet ID, you can still run these lessons in the cloud, by clicking this button:
If you are loading Binder with this repository for the first time, it may take a few minutes to set up. Binder operates similarly to the D-Lab DataHub, but on a different set of servers. By using Binder, however, you cannot save your work.
Now that you have all the required software and materials, you need to run the code:
Provide instructions on running the code, including how to load relevant software (RStudio, Jupyter Notebooks, etc.) and which file to open up. See other repositories for examples.
Additionally, provide instructions on how to run code once it’s open (running Jupyter cells, RMarkdown cells, etc.).
D-Lab works with Berkeley faculty, research staff, and students to advance data-intensive social science and humanities research. Our goal at D-Lab is to provide practical training, staff support, resources, and space to enable you to use R for your own research applications. Our services cater to all skill levels and no programming, statistical, or computer science backgrounds are necessary. We offer these services in the form of workshops, one-to-one consulting, and working groups that cover a variety of research topics, digital tools, and programming languages.
Visit the D-Lab homepage to learn more about us. You can view our calendar for upcoming events, learn about how to utilize our consulting and data services, and check out upcoming workshops.
D-Lab offers a variety of R workshops, catered toward different levels of expertise.
Soliver Fusi