From the course: Creating Maps with R

Unlock the full course today

Join today to access over 24,200 courses taught by industry experts.

ggplot2 choropleth and continuous data

ggplot2 choropleth and continuous data

From the course: Creating Maps with R

ggplot2 choropleth and continuous data

- [Instructor] We're going to build this continuous variable choropleth using ggplot2. To do so, I need you to load the script in your 0 4 0 2 B project, and let's start running our code. Lines one through six, we're going to load our packages, and read in our data set and then lines eight through 11, we're going to join those two data sets together into one SF object. Let's print it to the console so we can see what it looks like. So, what we have is, we have the name of each of the boroughs of London. We've got the geometry column, and we've got the value column here which is telling us how many residents left school at the age of 16 or under. So, let's start building our ggplot2 chart with the function ggplot. We used a plus operator to add a geom SF layer, and we'll specify that data is equal to London school leavers SF. And what I want to do is I want to fill each of these boroughs dependent on the value…

Contents