View source: R/random_hierarchical_data.R
random.hierarchical.data | R Documentation |
This function generates random hierarchical data. Experimental.
random.hierarchical.data(
n = NULL,
method = "random",
number.children = 3,
children.root = 4,
depth = 3,
nodes.per.layer = NULL,
labels = c("LETTERS", "numbers", "letters"),
labels.prefix = NULL,
sep = ".",
colnames = c(paste("index", 1:depth, sep = ""), "x"),
value.generator = rlnorm,
value.generator.args = NULL
)
n |
number of leaf nodes. This is a shortcut argument. If specified, the method is set to |
method |
one of
|
number.children |
the number of children. For |
children.root |
number of children of the root node. For |
depth |
depth of the tree. Note that for |
nodes.per.layer |
exact number of nodes per layer, that is needed for |
labels |
one of |
labels.prefix |
vector of label prefixes, one for each layer |
sep |
seperator character |
colnames |
names of the columns. The first |
value.generator |
function that determine the random values for the leaf nodes |
value.generator.args |
list of arguments passed to |
d <- random.hierarchical.data(200)
treemap(d, index=names(d)[1:(ncol(d)-1)], vSize="x")
d <- random.hierarchical.data(number.children=5)
treemap(d, index=names(d)[1:(ncol(d)-1)], vSize="x")
d <- random.hierarchical.data(method="full.tree", number.children=3, value.generator=runif)
treemap(d, index=names(d)[1:(ncol(d)-1)], vSize="x")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.