geom_sankey | R Documentation |
Creates a sankey plot which visualize flows between nodes. Each observation needs to have a 'x' aesthetic as well as a 'next_x' column which declares where that observation should flow. Also each observation should have a 'node' and a 'next_node' aesthetic which provide information about which group in the y-direction. By default each row of the data frame is counted to calculate the size of flows. A manual flow value can be added with the 'value' aesthetic.
geom_sankey(
mapping = NULL,
data = NULL,
position = "identity",
na.rm = FALSE,
show.legend = NA,
space = NULL,
type = "sankey",
width = 0.1,
smooth = 8,
inherit.aes = TRUE,
...
)
mapping |
provide you own mapping. both x and y need to be numeric. |
data |
provide you own data |
position |
change position |
na.rm |
remove missing values |
show.legend |
show legend in plot |
space |
space between nodes in the y-direction |
type |
either 'sankey' or 'alluvial' |
width |
width of nodes |
smooth |
how much smooth should the curve have? More means steeper curve. |
inherit.aes |
should the geom inherits aestethics |
... |
other arguments to be passed to the geom |
ggplot layer
geom_sankey understand the following aesthetics (required aesthetics are in bold):
- **x0** - **y0** - **a** - **b** - **angle** - m1 - m2 - color - fill - size - linetype - alpha - lineend
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.