Draw Line Segments between Particular Points in R Programming – segments() Function
segment() function in R Language is used to draw a line segment between to particular points.
Syntax: segments(x0, y0, x1, y1)
x, y: coordinates to draw a line segment between provided points.
Returns: a line segment between given points
Example 1: To draw a single line segment
Here, x0 & y0 are starting points of the line segment and x1 & y1 are ending points of line segment .
Example 2: Modifying color, thickness & line type
Example 3: Draw multiple line segments to R Plot.