Book Image

R Data Visualization Cookbook

Book Image

R Data Visualization Cookbook

Overview of this book

Table of Contents (17 chapters)
R Data Visualization Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Introducing choropleth maps


Choropleth maps have been extensively used as a medium to represent statistical data. Choropleth maps can be used to represent different data types, such as quantitative, diverging, or qualitative data, using color schemes. The RColorBrewer website provides a great guide to select the color scheme based on the data available to the user. Legends play a very vital role in choropleth maps as we need to state what each color represents in a map.

Choropleth maps can be state level as well as county level. In this recipe, we will plot well-being data on a state level. The data is made available by Gallup (http://www.gallup.com/home.aspx).

Please note that there is more than one way to plot a choropleth map. We can use the basic R plotting function along with the maps package or use ggplot to plot a choropleth map. The benefit of the googleVis package is that it makes the plot interactive and makes it easy to integrate with web pages or blogs.

Getting ready

We need to install...