Re: [R] Concave Hull?

From: Ted Harding <Ted.Harding_at_nessie.mcc.ac.uk>
Date: Wed 03 May 2006 - 08:16:56 EST


On 02-May-06 Mike Saunders wrote:
> I am modeling a trend surface using trmat and want to trim the
> resulting matrix to the area enclosed by my real data (i.e.,
> remove all the extrapolated areas). I was using chull and
> in.chull to calculate the convex hull and change all the other
> values created by trmat to NA. However, my real data has portions
> that are slightly concave so chull would give me slivers that are
> extrapolations from my data. Is there some other type of "chull"
> function that will allow the resulting polygon to be slightly
> concave? (I can send a picture to show what I am trying to do,
> if needed)

If I understand you correctly, what you are trying to do is not well-determined, though one can think of ways of achieving the general aim.

One approach might be to replace each segment of the convex hull by a circular arc, pulled perhaps towards the centroid until it first meets an interior point.

Or you might, for each bounding segemtn fo the convex hull:

  1. Select the nearest interior point to a boundary segment, and make it the vertex of a triangle whose other two are the end-points of the segment; then remove the segemnt. Or:
  2. Select the two nearest points to the segment and, along with the two end-points, make the convex hull of these four points; then remove the segment. Or: ...
  3. Select the k nearest points to the segment and make the convex hull of these k+2 points; then remove the segment. ...

Come to think of it, perhaps your picture might help!

Best wishes,
Ted.



E-Mail: (Ted Harding) <Ted.Harding@nessie.mcc.ac.uk> Fax-to-email: +44 (0)870 094 0861
Date: 02-May-06                                       Time: 23:16:52
------------------------------ XFMail ------------------------------

______________________________________________
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 Wed May 03 08:32:31 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Fri 05 May 2006 - 04:09:57 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.