[R] using identify() together with plot () and pixmap()

Barry Rowlingson B.Rowlingson at lancaster.ac.uk
Tue Sep 30 10:38:31 CEST 2003

Christoph Lehmann wrote:

> warning: no point with 0.25 inches
> pressing the right mouse button I get:
> numeric(0)
> what is the problem  here and how can I solve it?

  The problem is that there is no method for identifying points on a 
pixmap (and anyway, you are feeding identify() a matrix).

  You'll need to write an "identify.pixmapGrey" function. This would do 
something like use the 'locator()' function to get clicks on the screen, 
and then it would compute which grid cell the coordinates of those 
clicks were in. pixmap objects store enough information for you to work 
this out from the attributes - look at the 'bbox' attribute for example.

  It would make a nice addition to the pixmap library. Although one 
thing that just suprised me was that the different flavours of pixmap - 
pixmapGrey, pixmapIndexed, pixmapRGB - dont all inherit from a 'pixmap' 
class, which might make it easier to write a single identify function 
for all the types.


More information about the R-help mailing list