This repository provides materials for a session on the Leaflet package in R that is part of the I2DS Tools for Data Science workshop run at the Hertie School, Berlin in November 2021. The student-run workshop is part of the course Introduction to Data Science taught by Simon Munzert at the Hertie School, Berlin, in Fall 2021.
This session will introduce you to creating interactive maps with the Leaflet package in R.
Leaflet is one of the most popular open-source JavaScript libraries for creating interactive maps. It's used by websites ranging from the New York Times and Washington Post to GitHub and Flickr. As aspiring data scientists, Leaflet helps you visualize and communicate your findings in interactive maps.
Leaflet is free, open-source, well-documented, easy to learn, uses a familiar R framework (e.g., the pipe operator), and can be extended with lots of plugins. The best thing about it? You don't need to know how to write JavaScript. The Leaflet package in R makes it very easy to create and integrate Leaflet maps in R.
Our presentation slides can be downloaded as a PDF file here.
The goals of this session are to (1) equip you with motivation and conceptual knowledge about the core features and applications of the Leaflet package, (2) show you the basic steps of creating interactive maps in R, and (3) provide you with a live demonstration in the practice material as well as further resources.
- Florian Winkler, MDS (LinkedIn)
- Jiayu Yang, MDS
- Comprehensive documentation for Leaflet in R (including code, examples and further references)
- Leaflet cheat sheet
- Hands-on YouTube tutorial for basic Leaflet features (e.g., markers, popups, labels and polylines)
- Collection of free third-party basemaps (map tiles) for Leaflet
- Leaflet website for JavaScript (for those of you interested in the more advanced side of things)
The material in this repository is made available under the MIT license.
Florian Winkler prepared the practice material for the live tutorial and contents on presentation slides 3 to 9. He recorded the first part of the presentation video (slides 1 to 8, 7 minutes) and post-processed the recording.
Jiayu Yang created the presentation slides' design and prepared contents on slides 10 to 21. He recorded the second part of the presentation video (slides 9 to 21, 8 minutes) and proofread the practice material.