Hello!
I would like the value to be visualized on the Sankey chart.
how could i do it?
I need the graph in image format but when saving the value of the nodes is not displayed.
This is the code I used:
library(tidyverse)
library(readr)
library(openxlsx)
library(xlsx)
library(dplyr)
library(readxl)
library(networkD3)
datosankey <- read.csv("https://docs.google.com/spreadsheets/d/e/2PACX-1vS45SekhiRvzq8PXATIpG9HjwqNBloVGBuey4Zmf7eM0CPTFKGeT7ZnB_KaSKml_gPF5gzt5nHFbQUs/pub?output=csv")
datosankey$target <- paste(datosankey$target, " ", sep="")
nodes <- data.frame(name=c(as.character(datosankey$source), as.character(datosankey$target)) %>% unique())
datosankey$IDsource=match(datosankey$source, nodes$name)-1
datosankey$IDtarget=match(datosankey$target, nodes$name)-1
sankeyNetwork(Links = datosankey, Nodes = nodes,
Source = "IDsource", Target = "IDtarget",
Value = "value", NodeID = "name",
sinksRight=FALSE, nodeWidth=60,
fontSize=9,
nodePadding=7)->sankey
sankey