Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting node attributes for multiple morphed subraphs #159

Open
jdfoote opened this issue Jul 4, 2022 · 1 comment
Open

Getting node attributes for multiple morphed subraphs #159

jdfoote opened this issue Jul 4, 2022 · 1 comment
Labels
bug an unexpected problem or unintended behavior

Comments

@jdfoote
Copy link
Contributor

jdfoote commented Jul 4, 2022

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.

Is there a way to get the degree for each subgraph?

@thomasp85
Copy link
Owner

Thanks - indeed only the first result is kept. I'll have to think about how to address this best

@thomasp85 thomasp85 added the bug an unexpected problem or unintended behavior label Nov 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

2 participants