graphics - How to create Lines connecting two points in R -
is there way create lines in r connecting 2 points? aware of lines(), function, creates line segment looking infinite length line.
here's example of martha's suggestion:
set.seed(1) x <- runif(2) y <- runif(2) # function segmentinf <- function(xs, ys){ fit <- lm(ys~xs) abline(fit) } plot(x,y) segmentinf(x,y)
Comments
Post a Comment