简体   繁体   English

强制导向图绘制:编辑特定节点之间的力(R)

[英]Force-directed graph drawing: Edit the force between specific nodes (R)

I want to analyse a social network using the R packages statnet and/or igraph in reference to force-directed graph drawing (kamada.kawai/fruchterman.reingold). 我想使用R包statnet和/或igraph参考强制导向图绘制(kamada.kawai / fruchterman.reingold)来分析社交网络。 I wounder, if it is possible to adjust the "force" between 2 specific nodes, eg to consider a larger or smaller cooperation between 2 stakeholders. 如果可以调整2个特定节点之间的“力”,例如考虑2个利益相关者之间的更大或更小的合作,我就更有意思了。 However, i do not want to edit the general force between all nodes 但是,我不想编辑所有节点之间的一般力量

(as proposed here:) (如此处提议:)

How do I lengthen edges in an igraph network plot (layout=fruchterman.reingold)? 如何延长igraph网络图中的边缘(layout = fruchterman.reingold)?

The idea on this would be to get a more realistic image of a social network, also for further analysis. 对此的想法是获得更真实的社交网络图像,也用于进一步分析。

Thanks a lot and nice weekend to everybody! 非常感谢大家和周末!

This layout algorithm supports edge weights, which are basically used as multipliers for the attraction forces along the edges. 该布局算法支持边缘权重,其基本上用作沿边缘的吸引力的乘数。 Ie edges with high weight will tend to be shorter. 即,具有高重量的边缘将趋于更短。 Here is a simple example 这是一个简单的例子

library(igraph)

g <- graph.ring(10)

# Edge weights, will be recycled
E(g)$weight <- c(1,4)
coords <- layout.fruchterman.reingold(g, weights=E(g)$weight)

# Eliminate the margin
par(mar=c(0,0,0,0))
plot(g, layout=coords, vertex.color="#E495A5", vertex.size=20)

情节

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM