My dataframe looks like this.
(我的数据框看起来像这样。)
Word1 Word2 Count
--------------------------
a b 4
c a 2
b c 1
-------------------------
I want the following result.
(我想要以下结果。)
from to count
-----------------------
1 3 4
2 1 2
3 2 1
----------------------
I know I can achieve this easily using as_tbl_graph(df).
(我知道我可以使用as_tbl_graph(df)轻松实现这一目标。)
But I want this result only using base r code without using other packages. (但是我只希望使用base r代码而不使用其他软件包来获得此结果。)
How can I create identical result without using other packages such as igraph, ggraph, tidyverse ...? (如何在不使用igraph,ggraph,tidyverse等其他软件包的情况下创建相同的结果?)
ask by jjw translate from so 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…