Book Image

R Graph Essentials

Book Image

R Graph Essentials

Overview of this book

Table of Contents (11 chapters)
R Graph Essentials
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Chapter 3. Mastering the qplot Function

This chapter provides a step-by-step introduction to creating graphs using qplot (a graphics tool within the ggplot2 package), and gives examples of functioning qplot code that can be adapted for many applications. The topics covered in this chapter are as follows:

  • Loading the ggplot2 package in order to use qplot

  • Using basic qplot graphics techniques and syntax

  • Creating scatterplots and line graphs

  • Mapping symbol size, type, and color to categorical data

  • Including regressions and confidence intervals in your graphs

  • Creating bar charts, histograms, boxplots, pie charts, and dotcharts

  • Creating time series graphs with dates

It is not possible to give a complete account of qplot in this book. However, by the end of this chapter, you should be able to use qplot to create a wide range of graphs for research and analysis.