| f_2pline | R Documentation | 
The line connects two points c(x0, y0) and c(x1, y1).
f_2pline(x0, y0, x1, y1)
x0 | 
 A numeric value. The x-axis value of the first point.  | 
y0 | 
 A numeric value. The y-axis value of the first point.  | 
x1 | 
 A numeric value. The x-axis value of the second point.  | 
y1 | 
 A numeric value. The y-axis value of the second point.  | 
xs <- seq(-2, 2, length = 100)
lfun <- f_2pline(1, 1, -1, 5)
plot(lfun(xs), type = "l")
points(1, 1)
points(-1, 5)
lines(f_2pline(1, 1, 2, 1)(xs)) # horizonatal line
lines(f_2pline(1, 1, 1, 2)(xs)) # vertical line doesn't work
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.