Book Image

R Graphs Cookbook Second Edition

Book Image

R Graphs Cookbook Second Edition

Overview of this book

Table of Contents (22 chapters)
R Graphs Cookbook
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Introduction


In this chapter, we will look at bar, dot, and pie charts in detail. Bar charts are used commonly in reporting business data and scientific analysis. We will see how we can enhance the basic bar charts in R by adjusting some parameters in the base graphics library. There are a few different packages that can be used to make bar charts (most notably lattice and ggplot2). However, in this chapter, we will see how we can create many useful variations of bar graphs by using only the base library functions.

We will also look at a few recipes on pie charts—easily the most criticized type of chart in the scientific community, but also one of the most popular in the business world. While it is true that pie charts often obscure the data and are hard to read, the recipes in this chapter offer some ways to make pie charts more readable.

Some of the parameters are obscure and, sometimes, it might not be absolutely clear as to what values an argument can take. It is best to experiment as...