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

as_network #173

Closed
hoffab opened this issue Dec 7, 2021 · 1 comment · Fixed by #176
Closed

as_network #173

hoffab opened this issue Dec 7, 2021 · 1 comment · Fixed by #176
Assignees
Labels
bug Something isn't working

Comments

@hoffab
Copy link

hoffab commented Dec 7, 2021

Describe the bug
Using the as_network command on a specific igraph object (ffe_friends from the networkdata package) results in a multiplication of the number of vertices and edges, as well as loss of information on vertex attributes.

Provide system information

  • OS: MacOS Catalina 10.15.3
  • R version: 4.1.1
  • migraph version: 0.8.8

To Reproduce

  1. Installed migraph and the package network data
    library(migraph)
    library(networkdata)
    data(package = "networkdata")
    data("ffe_friends")
  2. Tried to convert the igraph object into a network object
    friends.network <- as_network(ffe_friends)
    summary(friends.network)
  3. See error: network object contains too many nodes and no more vertex attributes

Expected behavior
A conversion from an igraph to a network object that retains the original number of nodes as well as the vertex attributes.

Additional context
Add any other context about the problem here.

@hoffab hoffab added the bug Something isn't working label Dec 7, 2021
@BBieri
Copy link
Collaborator

BBieri commented Dec 8, 2021

Hi,

Thanks a lot for using {migraph} and reporting the issue in such a detailed way, it made it easy for me to reproduce the error. I have just pushed a commit addressing your issue. Loops and attributes now get correctly converted and the number of vertices stays at 28.

You should be able to access this feature in the coming days when the next patch comes out. I'll reply on this thread when it will be the case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants