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

head/tail #23

Closed
dahtah opened this issue Jul 19, 2017 · 1 comment
Closed

head/tail #23

dahtah opened this issue Jul 19, 2017 · 1 comment

Comments

@dahtah
Copy link

dahtah commented Jul 19, 2017

Not a major problem, but head and tail behave in a counter-intuitive manner, I think. I'd expect:

create_ring(10) %>% activate(nodes) %>% head

to return information on the first 10 nodes

create_ring(10) %>% activate(edges) %>% head

to return information on the first 10 edges, and finally

create_ring(10) %>% head

to maybe say that a graph doesn't have a head. tidygraph reverts to igraph's default in all cases. I thought I'd add a head.tbl_graph function myself, but noticed that a tbl_graph doesn't seem to have an unactivated state - it's nodes by default. Wouldn't it make sense to have such a state?

On an unrelated note (sorry), the initial table for nodes created by create_ * is empty - perhaps it'd make sense to initialise it with a single index column?

@thomasp85
Copy link
Owner

Don't think there's much sense in an unactivated state - you're either working with nodes or edges...

As for head/tail, I've been very deliberate in not masking any functionality from graph, so that it is almost certain that a tbl_graph will behave as an graph object if passed into a function that expects an graph object... if you want to glimpse the top of either nodes or edges just do %>% as_tibble

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