fortify_data_frame.dendrogram {ggalign} | R Documentation |
Build a data frame
Description
This function converts various objects to a data frame.
Usage
## S3 method for class 'dendrogram'
fortify_data_frame(
data,
...,
priority = "right",
center = FALSE,
type = "rectangle",
leaf_pos = NULL,
leaf_braches = NULL,
reorder_branches = TRUE,
branch_gap = NULL,
root = NULL,
double = TRUE,
data_arg = NULL,
call = NULL
)
## S3 method for class 'hclust'
fortify_data_frame(data, ...)
Arguments
data |
A |
... |
Additional arguments passed to |
priority |
A string of "left" or "right". if we draw from |
center |
A boolean value. if |
type |
A string indicates the plot type, |
leaf_pos |
The x-coordinates of the leaf node. Must be the same length
of the number of observations in |
leaf_braches |
Branches of the leaf node. Must be the same length of the
number of observations in |
reorder_branches |
A single boolean value, indicates whether reorder the
provided |
branch_gap |
A single numeric value indicates the gap between different branches. |
root |
A length one string or numeric indicates the root branch. |
double |
A single logical value indicating whether horizontal lines
should be doubled when segments span multiple branches. If |
data_arg |
The argument name for |
call |
The execution environment where |
Value
A data frame
with the node coordinates:
-
.panel
: Similar withpanel
column, but always give the correct branch for usage of the ggplot facet. -
.index
: the original index in the tree for the the node -
label
: node label text -
x
andy
: x-axis and y-axis coordinates for the node -
branch
: which branch the node is. You can use this column to color different groups. -
panel
: which panel the node is, if we split the plot into panel using facet_grid, this column will show which panel the node is from. Note: some nodes may fall outside panel (between two panels), so there are possibleNA
values in this column. -
leaf
: A logical value indicates whether the node is a leaf.
ggalign attributes
edge
: A data frame
for edge coordinates:
-
.panel
: Similar withpanel
column, but always give the correct branch for usage of the ggplot facet. -
x
andy
: x-axis and y-axis coordinates for the start node of the edge. -
xend
andyend
: the x-axis and y-axis coordinates of the terminal node for edge. -
branch
: which branch the edge is. You can use this column to color different groups. -
panel1
andpanel2
: The panel1 and panel2 columns have the same functionality aspanel
, but they are specifically for theedge
data and correspond to both nodes of each edge.
See Also
Other fortify_data_frame()
methods:
fortify_data_frame.character()
,
fortify_data_frame.default()
,
fortify_data_frame.matrix()
,
fortify_data_frame.phylo()
Examples
fortify_data_frame(hclust(dist(USArrests), "ave"))