I'm new to R, and attempting to use sample data to create a Sankey Diagram using rCharts.
I've run this code and it works as intended. However, when I edit that code with my source, target, and value vectors, R crashes and no diagram is produced.
Here is what I'm attempting to enter in place of the above example's source, target and values:
target <- c('1', '1', '1', '1', '2', '2', '2', '3', '3', '3', '4', '4', '4', '4', '4', '5', '5', '5', '5')
source <- c('2', '3', '4', '5', '1', '3', '4', '2', '3', '4', '1', '2', '3', '4', '5', '1', '2', '4', '5')
value <- c(1, 2, 2, 1, 1, 1, 4, 1, 2, 1, 1, 1, 1, 2, 2, 1, 2, 2, 2)
For clarity, here's a smaller example I've produced using my data:
source <- c('2', '5', '5')
target <- c('4', '2', '5')
value <- c(1, 1, 1)
This also crashes. My understanding of Sankey Diagrams is that this should produce a chart where '2' flows to '4', and '5' flows to '2' and '5' with lines of equal thickness.
I'm assuming there's something wrong with the data itself, because I've tried to have the same formatting as the other examples I've seen. If anyone could explain what's wrong with my understanding here, that would be much appreciated!