Dear R People: I'm using the locator() function on a chart and I select two values. Is there a way already in place to connect the two values with a line segment, please? Just thought I'd check before I started coding. Thanks in advance, Sincerely, Erin -- Erin Hodgess Associate Professor Department of Computer and Mathematical Sciences University of Houston - Downtown mailto: erinm.hodgess at gmail.com
Do you mean like:> plot(1:10) > locator(2, type='l')-- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.snow at imail.org 801.408.8111> -----Original Message----- > From: r-help-bounces at r-project.org [mailto:r-help-bounces at r- > project.org] On Behalf Of Erin Hodgess > Sent: Thursday, July 29, 2010 10:50 AM > To: R help > Subject: [R] locator function and connecting segment > > Dear R People: > > I'm using the locator() function on a chart and I select two values. > > Is there a way already in place to connect the two values with a line > segment, please? > > Just thought I'd check before I started coding. > > Thanks in advance, > Sincerely, > Erin > > > -- > Erin Hodgess > Associate Professor > Department of Computer and Mathematical Sciences > University of Houston - Downtown > mailto: erinm.hodgess at gmail.com > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting- > guide.html > and provide commented, minimal, self-contained, reproducible code.
Hi r-help-bounces at r-project.org napsal dne 29.07.2010 18:50:20:> Dear R People: > > I'm using the locator() function on a chart and I select two values. > > Is there a way already in place to connect the two values with a line > segment, please?I did this some time ago and put it to simple function cara<-function(col=1,lty=1,lwd=1) {body<-locator(2) segments(body$x[1],body$y[1],body$x[2],body$y[2],col=col,lty=lty,lwd=lwd)} regards Petr> > Just thought I'd check before I started coding. > > Thanks in advance, > Sincerely, > Erin > > > -- > Erin Hodgess > Associate Professor > Department of Computer and Mathematical Sciences > University of Houston - Downtown > mailto: erinm.hodgess at gmail.com > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guidehttp://www.R-project.org/posting-guide.html> and provide commented, minimal, self-contained, reproducible code.