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

can't convert dendrogram object to igraph object then plot as dendrogram with geom_edge_elbow #72

Closed
wkc1986 opened this issue May 3, 2017 · 1 comment

Comments

@wkc1986
Copy link

wkc1986 commented May 3, 2017

Trying to plot an igraph object that was converted from a dendrogram object with den_to_igraph, with dendrogram layout and geom_edge_elbow gives an error. MWE:

library(ggraph)
library(igraph)

dendro <- as.dendrogram(hclust(dist(iris[-5])))
igraf <- den_to_igraph(dendro)
ggraph(igraf, "dendrogram") + geom_edge_elbow()

gets

Error in eval(expr, envir, enclos) : object 'direction' not found

I would plot the dendrogram object directly, but I want to use tree_apply, which, as I understand, currently only works on igraph objects.

thomasp85 added a commit that referenced this issue Jan 10, 2018
* Use tidygraph as the central data format. The results of this are several:

  - All graph object supported by tidygraph are now supported on even footing in
    ggraph. All layouts are now available to any graph class
  - **BREAKING** The `"even"` layout for dendrograms are no more, but can be
    obtained by using the `"dendrogram"` layout with `height = NULL`
  - **BREAKING** All layouts uses NSE for arguments that refer to node and edge
    variables, instead of passing in strings that refer to the variable name.
  - All examples and vignettes now uses tidygraph for graph manipulation 
    resulting in much cleaner code.
  - `tree_apply` has been deprecated in favour of using `tidygraph::map_bfs_*`
  - `geom_edge_elbow` is no longer only available to dendrogram objects
  - tidygraph algorithms can now be used directly within ggraph functions. E.g.
    you can have `sort.by = node_rank_hclust()` in your specification of a 
    linear layout, or `aes(colour = group_infomap())` in node geoms
  
  This big change fixes #21, #72, #79, and #81
@thomasp85
Copy link
Owner

Fixed in 36fc2a9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants