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

Multiple parents. No root in graph. Provide graph with one parentless node: How to fix this error for ggraph?

$
0
0

I have data like this; two files:

Edge_list

node1   node2
x1      x2    
x1      x3      
x8      x4      
x4      x5     
x6      x7    

vertice_list:

node    weight
    x1   100
    x2   50
    x3   10
    x4   20
    x5   10
    x6   20
    x7   60

and I want to circlepack it, so I wrote this R code:

vertices <-read.table('vertice_list',header=TRUE,sep='\t')
edges <-read.table('Edge_list',header=TRUE,sep='\t')
ggraph(mygraph, layout = 'circlepack', weight='weight') +  geom_node_circle() +theme_void()

and I get the error:

Multiple parents. Unfolding graph
Error in FUN(X[[i]], ...) : 
  No root in graph. Provide graph with one parentless node

Could someone explain how to fix this? Thanks


Viewing all articles
Browse latest Browse all 201894

Trending Articles



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