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) 

enter image description here


Comments

Popular posts from this blog

ruby - Trying to change last to "x"s to 23 -

jquery - Clone last and append item to closest class -

c - Unrecognised emulation mode: elf_i386 on MinGW32 -