[R] Quantifying widths of polygons
bgunter.4567 at gmail.com
Fri Sep 25 17:02:38 CEST 2015
This is not the right list for such substantive questions.
I suggest that you check out the "spatial" and perhaps the
"Environmetrics" Task views on CRAN and/or post to a statistical site
like stats.stackexchange.com or the R-sig-ecology mailing list
"Data is not information. Information is not knowledge. And knowledge
is certainly not wisdom."
-- Clifford Stoll
On Fri, Sep 25, 2015 at 7:20 AM, Alexander Shenkin <ashenkin at ufl.edu> wrote:
> Hello all,
> I am working with data on tree crowns, and this data describes points
> (verticies) around the polyhedron of the crown volume (think of the crown as
> a single volume with vertices and faces). I can calculate maximum z
> distance between any 2 points (maximum depth) and maximum x/y distance
> (maximum width). These are useful metrics. I would also like to quantify
> an "average" width of the polygon in 2D space (x/y only), as well as a
> metric that would describe the "eccentricity" of the polygon. But, I'm not
> sure how to go about doing that.
> In general, I've made the polyhedrons and polygons into convex shapes.
> I have considered getting a centroid, intersecting lines every 10 degrees
> (for example) going through the centroid with the x/y polygon owin in
> spatstat, and then analyzing those line lengths. But, I'm not sure that's
> the right way to go, and maybe there are already tools out there to do this.
> Any thoughts anyone might have would be very welcome!
> x =
> y =
> z = c(5.5,4.5,4.3,4.8,6.7,5.8,7.4,6.2,3.5,2.9,4.0,3.7,3.2,3.0,3.1,8.4)
> depth = max(z) - min(z)
> width_max = max(dist(matrix(c(x,y),ncol=2)))
> xy_win = owin(poly=list(x=x,y=y))
> conv_win = convexhull(xy_win)
> # from here, maybe draw lines every 10 degrees through a centroid?
> # avg_width = ??
> # eccentricity = ??
> # 3D plot of crown polyhedron (convex)
> ps = data.frame(x=x,y=y,z=z)
> crown.surf = t(convhulln(matrix(c(x,y,z),ncol=3)))
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help