Skip to content

collapse = "all" for get_edges not working #362

Description

@julianbarg

edit for a more concise example.

I noticed that data = get_edges(collapse = "all") for edges isn't working. I was under the impression that this function argument should serve to remove redundant edges. Here is a code example:

library(tidyverse)
library(tidygraph)
library(ggraph)
graph <- tribble(
  ~from, ~to,
  "a", "b", 
  "a", "b", 
  "a", "c", 
  "b", "c"
  ) %>%
  as_tbl_graph()

layout <- create_layout(graph, layout = "kk")
get_edges("short", collapse = "all")(layout)

If the two redundant edges between "a" and "b" were collapsed into one, then the resulting df should have three rows. However, because the edges aren't collapsed, we have four rows and two redundant edges between "a" and "b".


tidygraph version: 1.3.0
ggraph version: 2.1.0
ggplot2 version: 3.4.4
OS: Linux/Debian 13 (trixie)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions