Description Usage Arguments Details Value Note Author(s) See Also Examples
View source: R/sample_geom_hypergraph.R
A hypergraph defined by the relationships amongst a set of points.
1 2 3 4 5 6 | sample_geom_hypergraph(n, m, d = 2, X, Y, radius,method = "Euclidean",
thresh.method="leq", uniformly = FALSE)
plot_geom_hypergraph(h, pch = 20, cex = 3, col = "gray",
plotY = TRUE, plot.circles = plotY,
full.circles=TRUE,
lty = 2, lcol = "black", ...)
|
n |
The number of points to generate (ignored if |
m |
The number of nodes in the hypergraph (ignored if |
d |
dimension of the points (ignored if both |
radius,uniformly |
see Description. |
X |
see Description. |
Y |
see Description. |
method |
method passed to |
thresh.method |
if this is 'leq' then hyper-edges are defined by whether the Y points are a distance less than or equal to the radius. If 'geq', then it is determined by greater than. Any other value will default to 'leq'. |
h |
a hypergraph generated by |
plotY |
logical. Whether to plot the |
pch,cex,col |
parameters controling the plotting of |
plot.circles,full.circles |
logical. Whether to plot the circles defining the hyper-edges.
If |
lty,lcol |
parameters controling the plotting of the circles. |
... |
parameters passed to |
If either X
or Y
is missing, it is generated as a set of
d-dimensional points in the unit cube, n
points in X
,
m
points in Y
. If X
is given, then n
is ignored. Similary with Y
and m
. If both are given,
then d
is ignored. There is no checking that the provided X
and/or Y
matrices conform to the n,m,d
values given in the
call.
The inter-point distance matrix is computed using dist
as proxy::dist(Y,X,method=method)
.
If radius
is not provided, it is
chosen uniformly at random from the unique values of the distance matrix
if uniformly
is FALSE, and uniformly from between the minimum and
maximum distance if uniformly
is true. As a rule, one should not
let this function choose the radius, but the code will do so if you wish.
The matrix is then thresholded by the
radius, resulting in a binary matrix which is then used as the
mxn incidence matrix for the hypergraph.
a hypergraph. Additionally, the defining vectors X
and Y
and the radius
are returned as named values of the hypergraph.
If both X
and Y
are given, and R
is not given,
a random value for R
is chosen randomly from the unique inter-point
distances.
If all three of these variables are provided, the hypergraph is not random.
David J. Marchette dmarchette@gmail.com
dist
.
1 2 3 4 5 6 7 8 9 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.