[R] locator()

Peter Dalgaard BSA p.dalgaard at biostat.ku.dk
Mon Oct 25 09:26:42 CEST 1999


"Stephen R. Laniel" <laniel at cmu.edu> writes:

> I'm trying to write a command that places the legend for a graph wherever
> I click the mouse.  So I tried
> 
> legend( locator(1), c("label 1", "label 2", "label 3"), lty=c(1,2,0),
> pch=c("  C"))
> 
> I ran the command, and it paused until it received a mouseclick.  But when
> I clicked well within the graphics window, I got this:
> 
> ``Error: non-numeric coordinates"

It is taking your labels for the y coordinate, try legend=c(etc...) 

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)             FAX: (+45) 35327907
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list