Chapter 2. Basic Graph Functions

In this chapter, we will cover the following recipes:

  • Creating scatter plots
  • Creating line graphs
  • Creating bar charts
  • Creating histograms and density plots
  • Creating box plots
  • Adjusting x and y axes limits
  • Creating heat maps
  • Creating pairs plots
  • Creating multiple plot matrix layouts
  • Adding and formatting legends
  • Creating graphs with maps
  • Saving and exporting graphs

Introduction

In this chapter, we will see how to use R to make some very basic types of graphs, which can be used in almost any kind of analysis. The recipes in this chapter will give you a feel for how much can be accomplished with very little R code, which is one big reason why R is a good choice for an analysis platform.

Although the examples in this chapter are ...

Get R: Data Analysis and Visualization now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.