So the last thing we're going to really talk about is that you may want to actually digitally draw shapes on your map, okay? So here we're going to show you how to draw some circles and it will be pretty obvious how you do that. And then we'll show you how to draw some rectangles, and then we'll show you how to add a legend. So these couple of commands will get you started, and then there's obviously more. These couple of cans will get you started on really annotating and kind of drawing on your map in very useful ways. And we're going to give you an example of at least drawing with a circle, in a way that you might actually want to do. Okay, so let's go ahead. Okay, so this is a nice example because it's sort of along the lines of something you might really want to do. So here, what we have is a collection of cities. So we have the cities, their names are Baltimore, Frederick, Rockville, Gaithersburg, these are all cities right around Baltimore. Okay, and it gives you the population here. Okay, and it gives you the latitude and the longitude. So, now we're going to take our cities dataset, we're going to pass it to leaflet, we're going to pass the output of that to add tiles. Okay, now it's got our mapping data. And then we're going to add circles. So remember, we talked about the addCircles command in the last lecture, okay, but now we're going to pass in some important options. So, the wait, we'll show you what happens when we change that, but we want the radius to be scaled relative to the population of the cities. Okay so this is a more reasonable use of adding circles than just having them as the markers, okay? So here let's go ahead and do it. Oop, I've gotta actually run, get the cities. There we go. All right, and then see here. So we've got Baltimore is a much larger city say than Annapolis in terms of population, okay? And so the size of the circle is representative of the population. Let's change that weight to let's weight to let's say 10. And that's the way to really look at options, is just make them much bigger, okay? There, now you say what weight does, it does the kind of the outline of the circle. Just to make it even more apparent, let's do it to 100. So yeah, when you're looking at options, just make them as extreme as you can and then that'll show you what they're doing. So that looks terrible but now we understand what the wake does. There we go, let's get it back just because it looks way better at weight equal 1. Okay, now, let's just try doing a rectangle. Just to show you what adding a rectangle looks like. So, we're going to take leaflet, add tiles, and then we're going to add a rectangle. But this time, just to show you, we're going to give you one rectangle. And in this case with the rectangle you are just giving its two corners. So all you need for rectangle is two opposite corners, it can't be two corners on the same line. Two opposite corners, there is the rectangle, all right? So apparently, we're rectangling the Mountain View Corporate Center, okay? Now, let's cover the final thing which is adding a legend. So it will be very common task where you want to add circles or add annotations like these rectangles and circles but you want them to be have a different color. And then you want a legend so that the user of the map can understand what each of the separate annotations means. Okay, so, here we have a data frame that's got 20 points. And the colors are going to be red, blue, and green. And, so there we go. Okay, so let's just look this data framework, quick head data frame. We'll do that for us. Okay, we got a bunch of latitude and longitude points. In colors blue, red, green, and so on. Okay, then we take our data frame, we're going to pass the leaflet. Add the mapping data. Now we're going to add just the circle markers, only now the only differences we're going to have them colored by their random color that we generated. Now of course, when you're doing this on your own, you're going to want your colors to be important like this county is going to tend to vote Democrat and this other county's going to tend to vote Republican or something like that. And in that case, you of course want the colors to not be assigned at random. Okay, so hopefully that point is not that hard. So now the last thing, and the only thing we want to talk about is adding a legend. Okay, so adding a legend operates a lot like the legend command in base R plotting, okay? So the labels are just LETTERS[1:3] and that's not anything in specific, we just made up labels in this case. So if you type letters that's just pre-defined vector in our. So if you type letters one to three it just gives you a, b, c, okay? So that we're just making up. You would obviously want this to be set say for example to Democrat, Republican, other or something like that. Okay, and then the colors are blue. Blue, red, and green, okay? So let's go ahead and run this, and then you'll see your legend right up here, okay? So that tells you what the colors of your dots means. And of course in your example you'll have more meaningful colors and more meaningful dots, but now you know how to do it. Okay, so I hope, this was the last lecture on Leaflet. I hope you found it useful. Honestly, I think Leaflet is probably one of the most useful things we'll cover in this class. And you can use Leaflet in conjunction with Shiny to create some really amazing applications. Nonetheless, I think this is one of the easiest interactive plotting. Utilities that you have in our, and certainly is worth your time to learn. Okay, thanks, and I look forward to seeing you in the next lab.