-1
I am studying a topic of networks and need to represent all the connections between a Vertice and those connected to it, directly and indirectly, so I thought to make an iterative link between tables of the type:
Be the table to be used in left_join
:
ligacoes <- data.frame(origem=c("A","A", "B", "B", "D"),
destino=c("B","D","C","D", "E"),
valor=c(31.2, 100, 1, 85, 2))
I intended to represent all links with origin at vertex A, so I thought to perform a left Join between the table links and the table links connecting the destination column of the first with the source column of the second, as many times as the match returns results (in this sample example only 2 left Join since the 3rd left_join no longer returns results however in the dataset there may be cases where a higher left_join number is required). Can someone help me? Obg
Very interesting the solution. In my case I have thousands of direct links between vertices and I need to list in a table the source vertex (e.g. A) with all vertices to which it is directly and indirectly connected, in the example that indicates would be: A-B, A-D, A-C (through B), A-E (through D)). Registering the number of connections would also be interesting as well as the weights (e.g. A-E has 2 edges and the final weight would be 100*2). I believe that the solution indicated does not allow the construction of the necessary table.
– user250908
All this can be done by igraph, but what you’re asking is too wide for this space. First see the documentation and tutorials of the package and, if necessary, post questions about specific and specific difficulties you find. Remember that the OS is not a forum.
– Carlos Eduardo Lagosta