操纵df以创建网络数据

时间:2019-04-27 14:00:37

标签: r networking data-manipulation df

我有这个df的例子:

  author other_authors
1      A       D, E ,F
2      B             G
3      C          H, F

我需要从中创建一个协作网络。

我已经阅读了这篇文章,但是做不到。 https://amirhosblog.wordpress.com/2016/09/29/co-authorship-analysis-in-r/

我正在工作的df需要转换为如下形式:

     author    author2 author3 author4
1      A       D       E       F
2      B       G
3      C       H       F

,然后再次转换为edgesnodes df。

有关如何操作的任何想法?我真的很着急。

此处是df:

df <- structure(list(author = c("A", "B", "C"),
                 other_authors = c("D, E ,F", "G", "H, F")), class = "data.frame", row.names = c(NA, -3L))

0 个答案:

没有答案
相关问题