Intro to Map Making in R
sf Logo

Simple features are a standardized way of encoding spatial vector data (points, lines, polygons) in computers. The sf package implements simple features in R, and has roughly the same capacity for spatial vector data as packages sp, rgeos, and rgdal.

Date: 03-09-2021

Instructor: Craig Helmann

Assistants: Hana Ševčíková, Christy Lam, Suzanne Childress, Polina Butrina

Prerequisites

R and the RStudio IDE are required. See the first module on R Basics for guidance.

The libraries we will be using today are sf, dplyr and leaflet. To ensure we are all using the same version, let's install them all again on our computers.

You can install the libraries by running the following code snippet in the console of your RStudio IDE. Ignore any warnings regarding Rtools and if you are asked to install from sources which needs compilation, click 'No'.

install.packages(c("sf", "dplyr", "leaflet"))

Leaflet Logo

Static maps are useful for creating figures for reports and presentation. Sometimes, however, you want to interact with your data. You can use leaflet for R to overlay your data on top of interactive maps. You can think about it like Google maps with your data overlaid on top!