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 intend to show you data visualization using the lattice package where producing conditional plots is much easier than the basic graphs. The focal point of the chapter will be basic graphs that are most commonly used during data visualization. Starting from a single variable bar chart, we will continue to conditional scatter plots. We will primarily use the lattice package to produce the graphs, but we will use other packages when required. If we use any other package, then we will mention the reason for that in the respective sections.

We will supply the dataset for this chapter or generate datasets through very simple random number generation functions in R. For example, runif() is used to generate a random number from a uniform distribution, rnorm() is used to generate a random variable from a normal distribution, and rbinom() is used to generate a binomial random variable. During the data generation process, we will use the code in such a way that all the...