/sotmus-r

Workshop materials for "Introduction to R + OSM", State of the Map 2018

Primary LanguageHTML

Introduction to R + OSM

This is a workshop put together by Angela Li of the Center for Spatial Data Science (CSDS) at UChicago for State of the Map 2018.

Learning Objectives

By the end of this workshop, workshop attendees should be able to:

  1. Install useful R packages
  2. Download OSM data from the OpenStreetMap API, using the osmdata R package
  3. Map downloaded OSM data in R
  4. Understand the two formats in which R stores spatial data

⭐️ Do This Now! ⭐️

Install Necessary Packages

Open RStudio and paste the following code into your console, then press Enter to run it:

# Download packages from CRAN
install.packages(c("devtools", "knitr", "magrittr", "sf", "sp", "rmarkdown", "usethis"))

# Download the osmdata package from Github
devtools::install_github("ropensci/osmdata")

Download Lesson Materials

Download this entire lesson (all code, notebooks, and data) to your computer desktop by running the following code in your RStudio console. Respond yes to all prompts:

usethis::use_course("https://github.com/angela-li/sotmus-r/archive/master.zip")

Once you've downloaded this lesson, open the .Rproj file to get started.

Contents

  • code: Raw R code generated from notebooks
  • data: Intermediate R data objects (to be used in case of bad Internet connection)
  • notebooks: R Markdown notebooks with R code, produced during workshop. Includes empty notebook and filled-out notebook.
  • slides: Intro slides

Additional Resources

References

Thanks to Jared Lander, Chris Prener, Jenny Bryan, Software Carpentry, and RStudio Education for informing the design of this workshop repository. In the same vein, please feel free to use this workshop as a template for your own R workshop. (If you do, give me a hoot!)