Share the Gallery !Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedInEmail this to someone

a

aaaaaaaaaaaaaaaaa

How to do a choropleth map with the leaflet R library.


First we need to to load the shape file of the world map to know the border position of every country. See graph #168 to have a complete description of this step. We can summarize this step with these 4 lines of code:

The world_spdf object contains the coordinates of the countries borders. It also contains the population size in 2005. You can see it in the world_spdf@data dataframe. With these 2 informations we can draw a choropleth map. There are several ways to pass from a numerical variable to palette of color. Leaflet proposes 3 possibilities that are described here:

aaaaaaaaaaeeeeeeaaaaaaaaaaaaaa

aaaaaaaaaaeeeeeeaaaaaaaaaaaaaa

aaaaaaaaaaeeeeeeaaaaaaaaaaaaaa

 


Not what you are looking for ? Make a new search !


Leave a Reply

Be the First to Comment!

Notify of
avatar
wpDiscuz