R GraphicsLesson 25Free preview
R Line
This lesson is part of R · All levels
Summary
This lesson reviews the creation of line graphs to analyze trends and time series data. Developers are taught how to create a single line graph with plot(..., type="l"), add secondary lines using the lines() function, as well as set the line thickness (lwd) and break-line style (lty).
Key points
- Line diagrams are ideal for observing changes in data over time.
- The 'lines(x, y)' function adds additional lines to an existing plot without creating a new plot window
- The 'lwd' argument (line width) determines the degree of line thickness
- The 'lty' argument (line type) specifies the line style (e.g.: 1=solid, 2=dashed, 3=dotted)
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.