treegraph {treemap} | R Documentation |
Create a tree graph
Description
This function draws a tree graph. By default, a radial layout is used.
Usage
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),
...
)
Arguments
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 |
Value
(invisible) igraph object
Examples
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")