-
-
Notifications
You must be signed in to change notification settings - Fork 203
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
graph_from_incidence_matrix()
errors when a sparse matrix contains NA
s and weighted = NULL
#917
Comments
graph_from_incidence_matrix()
crashes when a sparse matrix contains NA
s and weighted = NULL
@szhorvat how should NA in the incidence matrix be handled here? |
graph_from_incidence_matrix()
crashes when a sparse matrix contains NA
s and weighted = NULL
graph_from_incidence_matrix()
errors when a sparse matrix contains NA
s and weighted = NULL
The practical advice is: Don't ever pass NA to igraph. You can store it in attributes, but that's about all that's safe to do with NA. It will take some time to clean up the NaN/NA handling in igraph ... The long term plan on this is:
|
in the meantime, should the function error immediately if passed an incidence matrix with NA then? |
Yes, that is reasonable. If we can relax this restriction later, we will do that. But chances are we won't be able to. |
we could fix that in #1654 maybe? |
Describe the bug
For any NA elements in a sparse incidence matrix,
x[3]
in the following line will be NA, which results in an error:rigraph/R/incidence.R
Line 70 in da27d5b
To reproduce
Created on 2023-10-25 with reprex v2.0.2
Version information
The text was updated successfully, but these errors were encountered: