O'Reilly logo

R Programming Fundamentals by Kaelen Medeiros

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The plot() Function

The plot() function is the backbone of base plots in R. It provides capability for generic X-Y plotting. It requires only one argument, x, which should be something to plot—a vector of numbers, one variable of a dataset, or a model object such as linear or logistic regression. You can, of course, add a second variable, y, plus an assortment of options to customize the plot, but x is the only input required for the function to run successfully.

For anything beyond the basic x and y arguments to the function, you'll need to get very familiar with using ?plot or help(plot). The documentation suggests options, such as those ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required