Description Usage Arguments Value Examples
This function produces a data.frame of text that can be pasted into sankeymatic.com for the creation of sankey charts. It is essentially an unsatisfactory stop gap until some nice way of producing sankey charts in ggplot2 is introduced.
1 | sankeymatic(df, left, right)
|
df |
A data frame from which to creat the sankey chart. |
left |
A variable from the data frame that will feature on the left hand side of the sankey chart. |
right |
A variable from the data frame that will feature on the right hand side of the sankey chart. |
A data.frame with one column, 'sankeymatic', of nodes and counts in the format required by sankeymatic.com.
A data.frame is produced rather than a tibble as the print method allows row.names and right align to be suppressed. Text can then be copied directly from the console.
1 2 3 | library(ggplot2)
sankeymatic(diamonds, cut, color)
sankeymatic(diamonds, cut, color) %>% print(right = FALSE, row.names = FALSE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.