问题 Here is a reproducible example: library(networkD3) MyNodes<-data.frame(name= c("A", "B", "C", "D", "E", "F"), size= c("1","1","1","1","1","1"), Team= c("Team1", "Team1", "Team1", "Team1", "Team2", "Team2"), group= c("Group1", "Group1", "Group2", "Group2", "Group1", "Group1")) MyLinks<-data.frame(source= c("0","2","4"), target= c("1","3","5"), value= c("10","50","20")) forceNetwork(Links = MyLinks, Nodes = MyNodes, Source = "source", Target = "target", Value = "value", NodeID = "name",