Я написал следующий код, и все работает, но когда я ожидаю, что grpah появится на экране средства просмотра, он не появится.
library(networkD3)
links <- read.csv("C:/Users/tul45082/Desktop/CMA/DNA/linksV2.csv")
nodes <- read.csv("C:/Users/tul45082/Desktop/CMA/DNA/nodesV2.csv")
links$group <- as.factor(c("type_a", "type_b", "type_c", "type_d",
"type_e","type_a", "type_a", "type_a", "type_b",
"type_b","type_b", "type_b", "type_b", "type_c",
"type_c","type_c", "type_c", "type_c", "type_d",
"type_d","type_d", "type_e", "type_e", "type_e"))
nodes$group <- as.factor(c("n1","n2","n2","n2","n2","n2","n3","n3","n3","n3",
"n3","n3","n3","n3","n3","n3","n3","n3","n3","n3",
"n3","n3","n3","n3","n3"))
my_color <- 'd3.scaleOrdinal() . domain(["type_a","type_b", "type_c","type_d","type_e"])
.range(["#F3EAD1","#C8AE81","#B38C5A","#A38550","#522915"])'
sn <- sankeyNetwork(Links = links, Nodes = nodes, Source = "source",
Target = "target", Value = "value", NodeID = "names",
colourScale = my_color, LinkGroup = "group",
NodeGroup="group",fontSize = 10,fontFamily = "Arial",
nodeWidth = 0.5,nodePadding = 10, sinksRight = FALSE)
sn
Заранее спасибо за вашу помощь!