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

Creating donut plots and interactive plots


Schwabish (2014) describes and outlines a basic limitation of donut charts as, Donut charts—in which the centre of the pie is punched out—just exacerbate the problem: the empty centre makes the reader estimate the angle and arrive at other qualitative part-to-whole judgments without being able to see the center where the edges meet. Surprisingly, donut plots have their own followers and we do observe them in business reports or in news media as well. One of the places where donut charts can be useful is where the number of variables to be displayed is small, such as data related to yes versus no or male versus female.

Getting rady

To create a donut plot in R, we need to install the plotrix package in R.

How to do it...

Donut plots are basically pie charts with a hole punched in the middle. Hence, the first few lines of the code are very similar to the previous recipes and we will not get into the details at this point. We will first install the plotrix...