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.
By the end of this workshop, workshop attendees should be able to:
- Install useful R packages
- Download OSM data from the OpenStreetMap API, using the
osmdata
R package - Map downloaded OSM data in R
- Understand the two formats in which R stores spatial data
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 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.
code
: Raw R code generated from notebooksdata
: 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
osmdata
package website, Githubsf
package website, Github- overpass turbo website: try out sample Overpass API queries
- Geocomputation in R: free online book about analyzing, visualizing, and modeling spatial data in R
- R for Data Science: free online book about doing data science in R
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!)