Open jdfoote opened 2 years ago
I have a pretty simple use case that I'm struggling to figure out how to solve.
Basically, I want to know what the degree distribution is for each edge type. Here's a simple example:
G %>% activate(edges) %>% mutate(high_weight = weight > mean(weight)) %>% morph(to_split, high_weight, split_by='edges') %>% activate(nodes) %>% mutate(degree = centrality_degree(mode = 'all')) %>% unmorph() %>% as_tibble()
(I believe) the problem is that nodes are in both subgraphs, so the degree attribute in the nodes dataframe is overwritten, so it ends with just the degree of the last group in the split operation.
degree
Is there a way to get the degree for each subgraph?
Thanks - indeed only the first result is kept. I'll have to think about how to address this best
I have a pretty simple use case that I'm struggling to figure out how to solve.
Basically, I want to know what the degree distribution is for each edge type. Here's a simple example:
(I believe) the problem is that nodes are in both subgraphs, so the
degree
attribute in the nodes dataframe is overwritten, so it ends with just the degree of the last group in the split operation.Is there a way to get the degree for each subgraph?