[R] Labeling plot points

Doug Hill logickledoug at yahoo.com
Fri Dec 11 16:08:52 CET 2009


Greg, I tried installing v2.5 using the instructions on R-forge but ran into
errors:

> install.packages("TeachingDemos", repos="http://R-Forge.R-project.org")
Warning: unable to access index for repository
http://R-Forge.R-project.org/bin/windows/contrib/2.10
Warning message:
In getDependencies(pkgs, dependencies, available, lib) :
  package ‘TeachingDemos’ is not available

Looked like some dependency was not being found. Somehow I determined it
might be a missing tcl/tk-related package (don't remember how), so I did
this:

> library("tcltk")
Loading Tcl/Tk interface ... done
> lattice.demo(x,y,z)

Error in structure(.External("dotTclObjv", objv, PACKAGE = "tcltk"), class =
"tclObj") : 
  [tcl] floating point value is Not a Number.

So it got further but still not there. Any ideas?

BTW, I'm using R 2.10 on Windows.

Thanks,

Doug


Greg Snow-2 wrote:
> 
> There are 2 functions in the development version of the TeachingDemos
> package (the version on R-forge, not CRAN yet) that do just what you
> describe.  The functions are HWidentify which only works on windows
> machines and HTKidentify which uses the tcltk package.
> 
> Hope this helps,
> 
> -- 
> 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 Doug
>> Sent: Thursday, December 10, 2009 1:49 PM
>> To: r-help at r-project.org
>> Subject: [R] Labeling plot points
>> 
>> 
>> Hi, all. I've been searching for a while to find out how to create an
>> scatterplot which would let a user interact with it, specifically by
>> hovering the mouse over a point and having a pop-up appear with data
>> about
>> the point. The pop-up would disappear when the mouse moved away. I've
>> included a mock-up below.
>> 
>> I've found out how to use identify() to make a label appear when
>> clicking a
>> point, but as far as I can tell that label text remains on the plot
>> once
>> inserted. If pop-ups aren't supported in R, is there a way to make a
>> text
>> label disappear when the mouse is clicked again? Are there other R
>> graphic
>> libraries I should use for this kind of feature? Any pointers or sample
>> code
>> would be appreciated.
>> 
>> Thanks,
>> 
>> Doug
>> 
>> http://n4.nabble.com/file/n960517/Untitled.bmp
>> --
>> View this message in context: http://n4.nabble.com/Labeling-plot-
>> points-tp960517p960517.html
>> Sent from the R help mailing list archive at Nabble.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.
> 
> ______________________________________________
> 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.
> 
> 

-- 
View this message in context: http://n4.nabble.com/Labeling-plot-points-tp960517p961122.html
Sent from the R help mailing list archive at Nabble.com.




More information about the R-help mailing list