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, you will learn about some of the simplest yet most important settings and parameters of graphs in R base graphics. Learning how to adjust colors, sizes, margins, and styles of various graph elements such as points, lines, bars, axes, and titles will give us the ability to improve upon the basic graph commands you learned in Chapter 1, R Graphics.

In the previous chapter, we got a glimpse of the different types of graphs that can be created in R using small snippets of code. Now, you will learn how to modify the fundamental building blocks of these graphs to better suit our needs.

The R base library has very powerful graphical capabilities. While you can produce pretty much any type of graph with a couple of lines of code, the default layout and look of the graph is often very basic. Sometimes, you might run into problems such as axis labels and titles getting chopped off at the edges or the legend size or position masking part of your graph. Sometimes, the default...