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

Chapter 6. Creating Bar, Dot, and Pie Charts

In this chapter, we will cover the following recipes:

  • Creating bar charts with more than one factor variable

  • Creating stacked bar charts

  • Adjusting the orientation of bars – horizontal and vertical

  • Adjusting bar widths, spacing, colors, and borders

  • Displaying values on top of or next to the bars

  • Placing labels inside bars

  • Creating bar charts with vertical error bars

  • Modifying dot charts by grouping variables

  • Making better readable pie charts with clockwise-ordered slices

  • Labeling a pie chart with percentage values for each slice

  • Adding a legend to a pie chart