Re: [R] Mass 'identify' on 2d-plot

From: Duncan Temple Lang <duncan_at_wald.ucdavis.edu>
Date: Tue 06 Dec 2005 - 05:20:05 EST

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Barry Rowlingson wrote:
> Evgeniy Kachalin wrote:
>
>

>>What is ability in R to graphically (per mouse) define some area and to 
>>select all the cases felt in it?
>>
>>'identify' is OK for 5-10 cases, but what if cases=1000?

>
>
> You can use 'locator' to let the user click a number of points to
> define a polygon, and then use one of the point-in-polygon functions
> provided by one of the spatial packages to work out whats in your polygon.
>
> Look at splancs, spatstat, sp - pretty much anything beginning with
> 'sp' - on CRAN.
>
> In splancs you can just do:
>
> poly = getpoly()
>
> - which lets the user draw a polygon on screen, then:
>
> inPoly = inpip(xypts,poly)
> points(xypts[inpip,], pch=19,col="red")
>
> and that will plot the selected points in solid red dots.
>
> I don't think there's a way to draw a freehand figure on an R plot,
> you have to go click, click, click, and draw straight lines.

FWIW, there is an "experimental" package on the Omegahat site (and repository) named

   RGtkIPrimitives

that works with the gtkDevice only to do rubber banding and free form region identification.

>
> Barry
>
> ______________________________________________
> 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

iD8DBQFDlITV9p/Jzwa2QP4RAnEkAJ9W5Wiwj4Afp6HSq+x9WvsdeU4HeACfX/qH sAkmTAijaXVlhF0qtXA0Y1I=
=acyj
-----END PGP SIGNATURE-----



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 Tue Dec 06 05:24:39 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:41:28 EST