Chapter 16

Using Base Graphics

In This Chapter

arrow Creating a basic plot in R

arrow Changing the appearance of your plot

arrow Saving your plot as a picture

In statistics and other sciences, being able to plot your results in the form of a graphic is often useful. An effective and accurate visualization can make your data come to life and convey your message in a powerful way.

R has very powerful graphics capabilities that can help you visualize your data. In this chapter, we give you a look at base graphics. It’s called base graphics, because it’s built into the standard distribution of R.

Creating Different Types of Plots

The base graphics function to create a plot in R is simply called plot(). This powerful function has many options and arguments to control all kinds of things, such as the plot type, line colors, labels, and titles.

technicalstuff.eps The plot() function is a generic function (see Chapter 8), and R dispatches the call to the appropriate method. For example, if you make a scatterplot, R dispatches the call to plot.default(). The plot.default() function itself is reasonably simple and affects only ...

Get R For Dummies 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.