Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 201894

how can I create identical result without using as_tbl_graph()?

$
0
0

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 ...?


Viewing all articles
Browse latest Browse all 201894

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>