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). But I want this result only using base r code without using other packages. How can I create identical result without using other packages such as igraph, ggraph, tidyverse ...?