0
Based on a link df I want to select all possible paths consisting only of vertices whose links check a certain condition in this case value >=3
library(igraph)
library(dplyr)
df <- data.frame(
origem = c("A", "A", "A", "B", "C", "F", "D", "C"),
destino = c("B", "C", "D", "E", "F", "G", "H", "G"),
valor = c(3, 4, 2, 1, 5, 2, 7, 6))
df <- df %>% filter ( valor >= 3)
The goal is to group all vertices that are included in paths with value >=3 recording in a date.frame the ID of the group and for each ID the identification of the vertices that constitute it (a vertex will not be present in more than one group).
In the presented case it would have 2 groups constituted as follows:
ID X
1 A
1 B
1 C
1 F
1 G
2 D
2 H
Obg by the help. How to place the 2 obtained columns in a df: vertices and group to which they belong?
– user250908
I’ll edit the answer to include.
– Carlos Eduardo Lagosta