如何使用rgexf为我的.gexf文件添加法术?

时间:2022-10-31 18:34:03

I am trying to create a dynamic graph in gephi displaying interactions from a discussion forum from an online course. The nodes are students and the edges point from a student who asked a question to a student who answered.

我试图在gephi中创建一个动态图形,显示来自在线课程的讨论论坛的交互。节点是学生,边缘指向提问的学生和回答的学生。

Many of my edges are removed because they are "parallel edges", which means that they connect the same two people but have different time intervals. From what I have read, it seems it is possible to display these parallel edges if they are coded as "spells".

我的许多边缘被移除,因为它们是“平行边缘”,这意味着它们连接相同的两个人但具有不同的时间间隔。根据我的阅读,如果它们被编码为“法术”,似乎可以显示这些平行边缘。

What code would I use in R to code in spells?

我会在R中使用什么代码来编写法术代码?

1 个解决方案

#1


1  

As creator of the package I recommend that you should try the function check.dpl.edges (rgexf). This function tells you whether an edge is duplicated or not considering if the graph is directed or not. Following the example (an undirected graph):

作为软件包的创建者,我建议您尝试使用check.dpl.edges(rgexf)函数。此函数会告诉您边缘是否重复,考虑图形是否是定向的。以下示例(无向图):

> # An edgelist with duplicated dyads
> relations <- cbind(c(1,1,3,4,2,5,6), c(2,3,1,2,4,1,1))

> # Checking duplicated edges (undirected graph)
> check.dpl.edges(edges=relations, undirected=TRUE, order.edgelist=FALSE)
  source target reps
1      1      2    1
2      1      3    2
3      1      3   -1
4      2      4    2
5      2      4   -1
6      1      5    1
7      1      6    1

where the original relations matrix is

原始关系矩阵在哪里

> relations
     [,1] [,2]
[1,]    1    2
[2,]    1    3
[3,]    3    1
[4,]    4    2
[5,]    2    4
[6,]    5    1
[7,]    6    1

On the spells, rgexf also allows handling spells with the functions add.node.spell and add.edge.spell (see de documentation).

在法术上,rgexf还允许使用add.node.spell和add.edge.spell函数处理法术(请参阅de documentation)。

On how to pass a weights vector in write.gexf, you should use the argument edgesWeight.

关于如何在write.gexf中传递权重向量,您应该使用参数edgesWeight。

Please let me know if you have any doubts george dot vega at nodoschile.org

如果您对nodoschile.org上的george dot vega有任何疑问,请通知我

Best!

#1


1  

As creator of the package I recommend that you should try the function check.dpl.edges (rgexf). This function tells you whether an edge is duplicated or not considering if the graph is directed or not. Following the example (an undirected graph):

作为软件包的创建者,我建议您尝试使用check.dpl.edges(rgexf)函数。此函数会告诉您边缘是否重复,考虑图形是否是定向的。以下示例(无向图):

> # An edgelist with duplicated dyads
> relations <- cbind(c(1,1,3,4,2,5,6), c(2,3,1,2,4,1,1))

> # Checking duplicated edges (undirected graph)
> check.dpl.edges(edges=relations, undirected=TRUE, order.edgelist=FALSE)
  source target reps
1      1      2    1
2      1      3    2
3      1      3   -1
4      2      4    2
5      2      4   -1
6      1      5    1
7      1      6    1

where the original relations matrix is

原始关系矩阵在哪里

> relations
     [,1] [,2]
[1,]    1    2
[2,]    1    3
[3,]    3    1
[4,]    4    2
[5,]    2    4
[6,]    5    1
[7,]    6    1

On the spells, rgexf also allows handling spells with the functions add.node.spell and add.edge.spell (see de documentation).

在法术上,rgexf还允许使用add.node.spell和add.edge.spell函数处理法术(请参阅de documentation)。

On how to pass a weights vector in write.gexf, you should use the argument edgesWeight.

关于如何在write.gexf中传递权重向量,您应该使用参数edgesWeight。

Please let me know if you have any doubts george dot vega at nodoschile.org

如果您对nodoschile.org上的george dot vega有任何疑问,请通知我

Best!