R GraphicsLesson 24Free preview
R Plot
This lesson is part of R · All levels
Summary
This lesson reviews the basic graphical function plot() in R to visualize data into a point or line diagram. The plot() function is a generic function that adjusts visualization based on the type of object it receives. The developer will learn the axis adjustment, graphic title, color, and plot point type.
Key points
- The 'plot(x, y)' function is the most versatile basic graph function in R
- The 'type' argument sets the shape of the graph: 'p' for dots, 'l' for lines, 'b' for both
- The 'col' argument gives the color, the 'pch' selects the dot symbol, and the 'play' gives the main title.
- The arguments 'xlab' and 'ylab' set text labels on the horizontal and vertical axes
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.