Hi All,
convhulln {geometry} computes the convex hull of a set of points in n-
dimensions via .call, returning the hull itself, and also
"unavoidably generates a diagnostic report on an Rterm console." See
the example below.
I need to access the results of the diagnostic report (specifically
the computed hull volume) from within R, but I cannot see how.
I've looked at .call, but it is not clear to me how to get the text
of the "diagnostic report".
Any help would be greatly appreciated!
Thanks!
Dan
#example code
#set of points
(points=data.frame(x=rnorm(10),y= rnorm(10),z= rnorm(10)))
#compute hull
(hull1 = t(convhulln(points, options="QJ")))
#optional - plot hull with rgl
rgl.triangles(points[hull1,1], points[hull1,2], points
[hull1,3],col="blue",alpha=.2)
example output
> #set of points
> (points=data.frame(x=rnorm(10),y= rnorm(10),z= rnorm(10)))
x y z
1 -1.5625226 -0.6636375 -0.01373521
2 -0.2945998 -0.5152384 1.23246042
3 1.4209087 0.2085240 0.36009705
4 -0.2731960 -0.4556075 0.91815690
5 0.6231554 0.7472131 0.47208558
6 -0.6723569 -1.4897516 1.32757617
7 -1.3571404 0.2714682 -0.31701321
8 -0.7433676 -0.1174382 -1.12368941
9 0.3555069 1.3319899 1.65317140
10 -0.9877572 -0.2611568 -0.61043137
> #compute hull
> (hull1 = t(convhulln(points, options="QJ")))
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 6 6 8 8 7 7 5 5 5 5
[2,] 9 9 6 6 9 8 9 8 7 7
[3,] 1 3 1 3 1 1 3 3 9 8
qhull warning: joggle ('QJ') always produces simplicial output.
Triangulated output ('Qt') does nothing.
Convex hull of 10 points in 3-d:
Number of vertices: 7
Number of facets: 10
Statistics for: | qhull s Qt Tcv QJ
Number of points processed: 7
Number of hyperplanes created: 16
Number of distance tests for qhull: 39
CPU seconds to compute hull (after input): 0
Input joggled by: 6.9e-11
Output completed. Verifying that all points are below 6.9e-15 of
all facets. Will make 100 distance computations.
>
--
Daniel E. Bunker
TraitNet Associate Director
BioMERGE Associate Director
Post-Doctoral Research Scientist
Columbia University
Department of Ecology, Evolution and Environmental Biology
1200 Amsterdam Avenue
New York, NY 10027-5557
deb37ATcolumbiaDOTedu
917-843-5076 phone
212-854-8188 fax
[[alternative HTML version deleted]]