christophergandrud / networkD3

D3 JavaScript Network Graphs from R
http://christophergandrud.github.io/networkD3
650 stars 269 forks source link

Issue with igraph_to_networkD3 function #237

Open sahujagajjit opened 6 years ago

sahujagajjit commented 6 years ago

HI... I am trying to convert an igraph object to networkD3 object but getting the following error:

Error in sort.list(bx[m$xi]) : 'x' must be atomic for 'sort.list' Have you called 'sort' on a list? In addition: Warning messages: 1: In data.row.names(row.names, rowsi, i) : some row.names duplicated: 30,42,44,53,54,60,63,66,68,71,74,75,82,86,88,90,104,109,119,120,124,132,138,140,145,148,155,159,163,173,174,177,178,186,194,200,205,214,233,234,243,244,245,255,256,265,273,279,280,287,288,292,308,313,337,344,349,352,358,381,385,399,426,430,437,460,461,462,463,472,482,483,484,487,495,530,556,557,559,563,571,572,574,583,584,689,723,808 --> row.names NOT used 2: In data.row.names(row.names, rowsi, i) : some row.names duplicated: 30,42,44,53,54,60,63,66,68,71,74,75,82,86,88,90,104,109,119,120,124,132,138,140,145,148,155,159,163,173,174,177,178,186,194,200,205,214,233,234,243,244,245,255,256,265,273,279,280,287,288,292,308,313,337,344,349,352,358,381,385,399,426,430,437,460,461,462,463,472,482,483,484,487,495,530,556,557,559,563,571,572,574,583,584,689,723,808 --> row.names NOT used

cjyetman commented 6 years ago

Can you share the igraph object?

sahujagajjit commented 6 years ago

Sure....Here you go... g.RData.zip

Please extract the .RData file and find the igraph object g in it. I have the error while running the following piece of code:

wc <- cluster_walktrap(g) members <- membership(wc) d3obj4g <- igraph_to_networkD3(g, group = members)

Thank you...