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

The future of top_n()? #128

Closed
ofchurches opened this issue Oct 16, 2020 · 0 comments
Closed

The future of top_n()? #128

ofchurches opened this issue Oct 16, 2020 · 0 comments
Labels
feature a feature request or enhancement

Comments

@ofchurches
Copy link

Thank you so much for this package. I have used it so much over the last two years and will keep using and recommending it.

I have a frequent workflow that selects nodes with the highest value on some measure:

library(tidygraph)
iris_clust <- hclust(dist(iris[1:4]))

as_tbl_graph(iris_clust) %>%
  top_n(n = 10, wt = height)

I note that top_n() is reexported from dplyr. However, since dplyr release 1.0.0, top_n() has been superseded in favour of slice_min()/slice_max(). However, there appears to be no applicable method for slice_min()/slice_max() applied to tbl_graph objects created by tidygraph.

I see some changes due to dplyr 1.0.0 in tidygraph already (#119) and I can see good reasons either to change tidygraph verbs for consistency with dplyr or to keep tidygraph heading on its own path. I also appreciate that top_n() and slice_min()/slice_max() have interesting impacts on tbl_graph objects because they remove the edges terminating at the removed nodes and change the indexes of the to and from columns in the edge data. So this is a non-trivial job.

So, could I ask what your thoughts are about the future of top_n() in tidygraph?

It would really help me plan my code for the future to know how this is going to evolve.

Again, many thanks for your work. I really love this package.

@thomasp85 thomasp85 added the feature a feature request or enhancement label Nov 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature a feature request or enhancement
Projects
None yet
Development

No branches or pull requests

2 participants