treegraph | R Documentation |
This function draws a tree graph. By default, a radial layout is used.
treegraph(
dtf,
index = names(dtf),
directed = FALSE,
palette.HCL.options,
show.labels = FALSE,
rootlabel = "",
vertex.layout = "reingold.tilford",
vertex.layout.params,
truncate.labels = NULL,
vertex.size = 3,
vertex.label.dist = 0.3,
vertex.label.cex = 0.8,
vertex.label.family = "sans",
vertex.label.color = "black",
mai = c(0, 0, 0, 0),
...
)
dtf |
a data.frame or data.table. Required. |
index |
the index variables of dtf (see |
directed |
logical that determines whether the graph is directed ( |
palette.HCL.options |
list of advanced options to obtain Tree Colors from the HCL space (when
For "depth" and "categorical" types, only the first two items are used. Use |
show.labels |
show the labels |
rootlabel |
name of the rootlabel |
vertex.layout |
layout algorithm name. See |
vertex.layout.params |
list of arguments passed to |
truncate.labels |
number of characters at which the levels are truncated. Either a single value for all index variables, or a vector of values for each index variable |
vertex.size |
vertex.size (see |
vertex.label.dist |
vertex.label.dist (see |
vertex.label.cex |
vertex.label.cex (see |
vertex.label.family |
vertex.label.family (see |
vertex.label.color |
vertex.label.color (see |
mai |
margins see |
... |
arguments passed to |
(invisible) igraph object
data(business)
treegraph(business, index=c("NACE1", "NACE2", "NACE3", "NACE4"), show.labels=FALSE)
treegraph(business[business$NACE1=="F - Construction",],
index=c("NACE2", "NACE3", "NACE4"), show.labels=TRUE, truncate.labels=c(2,4,6))
treegraph(business[business$NACE1=="F - Construction",],
index=c("NACE2", "NACE3", "NACE4"), show.labels=TRUE, truncate.labels=c(2,4,6),
vertex.layout="fruchterman.reingold")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.