[R] locator()

From: Erin Hodgess <hodgess_at_gator.dt.uh.edu>
Date: Sat 04 Jun 2005 - 13:53:12 EST


Dear Sebastian:

Here is a snippet of code that you may find interesting for labeling points on the plane:

plane1 <- function(x,main1="") {
  plot(x,main=main1,ylab=" ")
  zz <- locator()
  text(zz$x,zz$y,

       labels=paste("(",round(zz$x,1),
         ",",round(zz$y,1),")",sep=""),
       pos=2,cex=.55)

    invisible()
}

Hope this helps!

Sincerely,
Erin Hodgess
Associate Professor
Department of Computer and Mathematical Sciences University of Houston - Downtown
mailto: hodgess@gator.uhd.edu



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Sat Jun 04 13:58:24 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:32:22 EST