ranHiveData | R Documentation |
This function generates random data sets which can be used to make a hive plot.
ranHiveData(
type = "2D",
nx = 4,
nn = nx * 15,
ne = nx * 15,
rad = 1:100,
ns = c(0.5, 1, 1.5),
ew = 1:3,
nc = brewer.pal(5, "Set1"),
ec = brewer.pal(5, "Set1"),
axis.cols = brewer.pal(nx, "Set1"),
desc = NULL,
allow.same = FALSE,
verbose = FALSE
)
type |
The type of hive plot to be generated. One of |
nx |
An integer giving the number of axes to be created ( |
nn |
An integer giving the number of nodes to be created. This is an initial number which may be reduced during clean up. See Details. |
ne |
An integer giving the number of edges to be created. This is an initial number which may be reduced during clean up. See Details. |
rad |
Numeric; a range of values that will be used as node radius values (the position of the node along the axis). |
ns |
Numeric; a range of values that will be used as the node sizes. |
ew |
Numeric; a range of values that will be used as the edge weights. |
nc |
A vector of valid color names giving the node colors. |
ec |
A vector of valid color names giving the edge colors. |
axis.cols |
A vector of valid color names to be used to color the axes;
|
desc |
Character; a description of the data set. |
allow.same |
Logical; indicates if edges may begin and end on the same
axis. Only applies to |
verbose |
Logical; If |
For type = "2D"
, after the function creates an initial set of random
nodes, these are randomly chosen and connected between adjacent axes, so
that no edge crosses an axis.
For type = "3D"
, after the
function creates an initial set of random nodes and edges, these are cleaned
up by removing the following cases (which the rest of HiveR
is not
intended to handle at this time): duplicated nodes, nodes that are not part
of any edge, edges that begin and end on the same point, edges that begin
and end on the same axis, and finally, for nx = 5 or 6
, edges that
begin and end on colinear axes. Most of these don't cause an error, but
produce some ugly results.
For the arguments rad, ns, ew, nc
and ec
, the values given are sampled randomly (with replacement) and
assigned to particular nodes or edges.
An object of S3 class HivePlotData
.
If you create a very small data set with few nodes, there
may be no nodes assigned to some axes which will give an error when you try
to plot the data. It's up to the user to check for this possibility (you
can use sumHPD
).
Bryan A. Hanson, DePauw University. hanson@depauw.edu
test4 <- ranHiveData(nx = 4)
str(test4)
sumHPD(test4)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.