statnet / ndtv

ndtv: Network Dynamic Temporal Visualizations in R
https://cran.r-project.org/web/packages/ndtv/index.html
50 stars 5 forks source link

Multigraphs not supported because of dependency on as.matrix.network.adjacency in network package #50

Open tedmoorman opened 2 years ago

tedmoorman commented 2 years ago

I created a network with the network function from the network package:

network(..., multiple = TRUE)

Then I converted to a dynamic network using the networkDynamic function from the networkDynamic package. When I try to use compute.animation, filmstrip, and render.d3movie from the ndtv package, I receive the same error:

Error in as.matrix.network.adjacency(net, attrname = weight.attr, expand.bipartite = TRUE) :
      Multigraphs not currently supported in as.matrix.network.adjacency. Exiting.

You can see the error message on line 173 of the network package code. On line 168, the as.matrix.network.adjacency function is defined.

Is there a workaround for this error? Or, will this dependency might be eliminated in the future?

Thank you for taking a look.

CarterButts commented 2 years ago

On the face of it, this seems to be working as intended: you created a multigraph, and it isn't supported for that function. Is there a reason that you are trying to use a multigraph here, and not a dynamic network object?

On 6/22/22 8:32 AM, tedmoorman wrote:

I created a network with the |network| function from the network package:

|network(..., multiple = TRUE) |

Then I converted to a dynamic network using the |networkDynamic| function from the networkDynamic package. When I try to use |compute.animation|, |filmstrip|, and |render.d3movie| from the ndtv package, I receive the same error:

|Error in as.matrix.network.adjacency(net, attrname = weight.attr, expand.bipartite = TRUE) : Multigraphs not currently supported in as.matrix.network.adjacency. Exiting. |

You can see the error message on line 173 of the network package code. On line 168, the |as.matrix.network.adjacency| function is defined. https://github.com/statnet/network/blob/27c88579a799d5ae8dfd72980b5b00dc012e5a09/R/coercion.R

Is there a workaround for this error? Or, will this dependency might be eliminated in the future?

Thank you for taking a look.

— Reply to this email directly, view it on GitHub https://github.com/statnet/ndtv/issues/50, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJM3GHQWSQZUZ2K7NTYLATVQMWXHANCNFSM5ZQVYL7Q. You are receiving this because you are subscribed to this thread.Message ID: @.***>

tedmoorman commented 2 years ago

I converted the network to a dynamic network object, and then I received the error. I think I found an example that provides a workaround, but the networkDynamic package is not recognizing one of my columns as numeric. I've submitted a separate issue here.

tedmoorman commented 2 years ago

Update: I had to go the route of a network list to get everything to work for me. The example here was very helpful. I'm not sure if this is ideal though ...