I am currently struggling with a sankey diagram visualising the flow of anti-cancer treatment for women with advanced breast cancer.
I have a columnn for each line of treatment (beh1, beh2 etc) naming the given treatment (6 options or "Other").
However, some of the patients do not receive all 6 lines of treatment that my df currently contains, and have thus been give a N/A in several columns.
An example
sankey <- data.frame(ID = c("1","2","3","4","5"),
Beh1 = c("TDM1","Capecitabine", "Capecitabine", "Eribulin", "TDM1"),
Beh2 = c("Capecitabine", "NA", "Taxane", "Eksperimentiel", "Taxane"),
Beh3 = c("Eribulin", "NA", "Eribulin", "Eribulin", "Eribulin"))
SankeyDiagram(sankey[-1],
link.color = "Source",
variables.share.values = TRUE,)
What I wished it showed:
Any help would be highly appreciated
Kind regards