当前位置: 代码迷 >> 综合 >> 10行代码动态展示权游
  详细解决方案

10行代码动态展示权游

热度:69   发布时间:2024-01-25 07:28:54.0

下载、处理人物关系数据

R语言人物关系图插件简介

nodes <- data.frame(id = 1:10, 
label = paste("Node", 1:10),                                 # add labels on nodes
group = c("GrA", "GrB"),                                     # add groups on nodes 
value = 1:10,                                                # size adding value
shape = c("square", "triangle", "box", "circle", "dot", "star",
"ellipse", "database", "text", "diamond"),                   # control shape of nodes
title = paste0("<p><b>", 1:10,"</b><br>Node !</p>"),         # tooltip (html or character)
color = c("darkred", "grey", "orange", "darkblue", "purple"),# color
shadow = c(FALSE, TRUE, FALSE, TRUE, TRUE))                  # shadow

head(nodes)

 绘制R语言人物关系图

library(visNetwork)
edges =read.csv('f:/net1.csv')
nodes=read.csv('f:/characters1.csv')
View(edges)
View(nodes)英国首相致函苏格兰首席部长

  相关解决方案